Difference between revisions of "Widget Manager"

From PowerUI
Jump to: navigation, search
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The window manager is a major subsystem in PowerUI. It creates self contained UI's, each called a window, which can be opened via a [[Windows (Web API)|web API]] or via the [[Window Protocol|window:// protocol]].  
+
The widget manager is used to create self contained UI's, each called a widget, which can be opened via a [[Widgets (Web API)|web API]] or via the [[Widget Protocol|widget:// protocol]]. Example scenes like 'Windows', 'Fading the screen' and 'Pause menu' all make use of the widget manager. Widgets can stack on top of each other and fire a range of events so you can easily know when they're ready to go.
 +
 
 +
A widget has two parts:
 +
 
 +
* A [[Widget Templates|template]] which describes its appearance. These are designed to be highly reusable.
 +
* Optionally some content to display within it. For example, you might have a template for a window and inside that window you display e.g. stats, worn clothing, an inventory etc.
 +
 
 +
== Parameters ==
 +
 
 +
You'll find that it's very often useful to pass some extra information to an opening widget. For example, maybe you have a widget which asks the player to type in a number of items between some given range. It can be done with both the [[Widget Protocol|widget:// protocol]] and the [[Widgets (Web API)|web API]]; both have the same outcome. See their wiki pages for more information on how to do it in each specific case.
 +
 
 +
The parameters are made available to the template ''and'' to any scripts inside your content as JavaScript variables.
  
 
== Scope ==
 
== Scope ==
  
The window manager is used for more than just typical "window" - it's designed to be used to describe any kind of self contained widget or component of a UI. For example, the [[Dialogue|dialogue system]] uses it to display speech and every [[Context Menu|context menu]] is also a window. [[Screen Fading (Fade to black/ Whiteouts)|Screen fading]] is also a more abstract use of the window system.
+
The widget manager is designed to be used to describe any kind of self contained widget or component of a UI. For example, the [[Dialogue|dialogue system]] uses it to display speech and every [[Context Menu|context menu]] is also a widget. [[Screen Fading (Fade to black/ Whiteouts)|Screen fading]] is also a more abstract use of the widget system.
  
 
== Templates ==
 
== Templates ==
  
The visual appearance of a window is described by a [[Window Templates|window template]]. PowerUI has a few built in templates for different kinds of window. Ideally these templates can be shared or sold to maximize the value of the window manager.
+
The visual appearance of a widget is described by a [[Widget Templates|widget template]]. PowerUI has a few built in templates for different kinds of widget. Ideally these templates can be shared or sold to maximize the value of the widget manager.

Latest revision as of 16:46, 20 March 2017

The widget manager is used to create self contained UI's, each called a widget, which can be opened via a web API or via the widget:// protocol. Example scenes like 'Windows', 'Fading the screen' and 'Pause menu' all make use of the widget manager. Widgets can stack on top of each other and fire a range of events so you can easily know when they're ready to go.

A widget has two parts:

  • A template which describes its appearance. These are designed to be highly reusable.
  • Optionally some content to display within it. For example, you might have a template for a window and inside that window you display e.g. stats, worn clothing, an inventory etc.

Parameters

You'll find that it's very often useful to pass some extra information to an opening widget. For example, maybe you have a widget which asks the player to type in a number of items between some given range. It can be done with both the widget:// protocol and the web API; both have the same outcome. See their wiki pages for more information on how to do it in each specific case.

The parameters are made available to the template and to any scripts inside your content as JavaScript variables.

Scope

The widget manager is designed to be used to describe any kind of self contained widget or component of a UI. For example, the dialogue system uses it to display speech and every context menu is also a widget. Screen fading is also a more abstract use of the widget system.

Templates

The visual appearance of a widget is described by a widget template. PowerUI has a few built in templates for different kinds of widget. Ideally these templates can be shared or sold to maximize the value of the widget manager.