Difference between revisions of "Widget Templates"

From PowerUI
Jump to: navigation, search
(Created page with "Window templates are a new way of easily making reusable, extremely extendible UI components in PowerUI. They are central to the ''window manager'' which forms the basis of ot...")
 
Line 1: Line 1:
Window templates are a new way of easily making reusable, extremely extendible UI components in PowerUI. They are central to the ''window manager'' which forms the basis of other systems such as [[Dialogue|dialogue (speech)]] and [[Context Menus|context menus]].
+
Window templates are a new way of easily making reusable, extremely extendible UI components in PowerUI. They are central to the [[Window Manager]] which forms the basis of other systems such as [[Dialogue|dialogue (speech)]] and [[Context Menus|context menus]].
  
 
== Making a template ==
 
== Making a template ==
Line 21: Line 21:
 
* MyTemplate/Resources/myTemplate-template.html
 
* MyTemplate/Resources/myTemplate-template.html
  
For an example of a built in window, check out the "Floating Window" which is at PowerUI/Source/Extras/Windows/Built in/Floating Window/
+
For an example of a built in window, check out the "Floating Window" which is at PowerUI/Source/Extras/Window System/Built in/Floating Window/

Revision as of 17:08, 13 January 2017

Window templates are a new way of easily making reusable, extremely extendible UI components in PowerUI. They are central to the Window Manager which forms the basis of other systems such as dialogue (speech) and context menus.

Making a template

A template requires these 3 parts:

  • A C# file which handles any logic for you.

Inside is a class which ultimately derive from Window (context menu's, for example, derive from ContextMenu which itself is a Window).

  • A html file which provides the basic style

(which is actually CSS, because Unity doesn't recognise .css as text)

  • A html file which provides the basic layout

Template structure

The (self contained) structure of those files is usually like this:

  • MyTemplate/myTemplate.cs
  • MyTemplate/Resources/myTemplate-style.html
  • MyTemplate/Resources/myTemplate-template.html

For an example of a built in window, check out the "Floating Window" which is at PowerUI/Source/Extras/Window System/Built in/Floating Window/