Difference between revisions of "LavishGUI:Elements"

From Lavish Software Wiki
Jump to navigation Jump to search
Line 35: Line 35:
 
*Visible
 
*Visible
 
: A toggle. Elements are visible by default.  Disable if this element should not be visible by default.
 
: A toggle. Elements are visible by default.  Disable if this element should not be visible by default.
 +
*StorePosition
 +
: A toggle. Enable if this element should have its position (relative to its parent) stored and restored automatically when unloading and loading this element.  The element's fully qualified name is used for this storage.
  
 
== Creating Element Types ==
 
== Creating Element Types ==

Revision as of 06:40, 18 September 2005

Introduction

What is an element?

An ISUI element is an individual portion of the user interface with its own characteristics, intended to be rendered with the user interface when "visible".

All ISUI elements are relative to their parent element. This means that its position is always based on its parent position, and if its parent is not visible, the element will also not be visible.

There are no restrictions on where elements can be placed, with exceptions only when specific elements indicate that they may only be used under other specific elements (for example, hudelement should only be used as a child of hud). This means that you do not need to place elements in a "window" -- you can have freefloating buttons (or anything else). Likewise, you can have a tab control inside a button.

ISUI elements with no parents are actually parents of an inaccessible "screen" element, which has X and Y position set to 0,0 and Height and Width set to the game's resolution.

Using Elements

Attributes

  • Name
All elements must have a name. The name must not be the same as any of its siblings, but may be the same as another element elsewhere (including this element's parent and children)

Properties

2D Positioning

  • X
Leftmost pixel, relative to its parent's left edge. May begin with "r" (short for reverse) to mean backwards, relative to the parent's right edge, such as r10 to mean "the parent's right edge, minus 10". May use a % to indicate a percentage of its parent's width (e.g. using 50% will place the leftmost pixel exactly halfway across its parent)
  • Y
Topmost pixel, relative to its parent's top edge. May begin with "r" (short for reverse) to mean upwards, relative to the parent's bottom edge, such as r10 to mean "the parent's bottom edge, minus 10". May use a % to indicate a percentage of its parent's height (e.g. using 50% will place the topmost pixel exactly halfway down its parent)
  • Width
Width in pixels. May begin with "r" (short for reverse) to indicate a width relative to the parent's width, such as r10 to mean "the parent's width, minus 10". May use a % to indicate a percentage of its parent's width
  • Height
Height in pixels. May begin with "r" (short for reverse) to indicate a height relative to the parent's height, such as r10 to mean "the parent's height, minus 10". May use a % to indicate a percentage of its parent's height
An Element with non-fixed positions will have positioning recalculated when its parent's positioning changes

Others

  • AlwaysOnTop
A toggle. Enable if this element should "always be on top", relative to its siblings
  • AutoTooltip
Text to be used for a tooltip for this element. Hovering over the element will automatically display this text in a tooltip
  • Children
A container. Place any elements to be children of this element in this container.
  • Visible
A toggle. Elements are visible by default. Disable if this element should not be visible by default.
  • StorePosition
A toggle. Enable if this element should have its position (relative to its parent) stored and restored automatically when unloading and loading this element. The element's fully qualified name is used for this storage.

Creating Element Types

Custom element types are created in Inner Space extensions. See ISXDK

See Also