Difference between revisions of "LavishGUI:lguielement (Data Type)"

From Lavish Software Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
== Description ==
 
== Description ==
 
+
This data type provides and controls data for ISUI elements.
 
== Members ==
 
== Members ==
 
* [[DataType:string|string]] '''Name''': Name of the element
 
* [[DataType:string|string]] '''Name''': Name of the element
Line 49: Line 49:
 
===Toggle an elements visibility===
 
===Toggle an elements visibility===
 
UIElement[main hud].FindChild[fps]:ToggleVisibile
 
UIElement[main hud].FindChild[fps]:ToggleVisibile
:Toggles fps element on and off
+
:This command toggles fps element on and off
 
===Display an elements width and height===
 
===Display an elements width and height===
 
*echo Width: ${UIElement[main hud].FindChild[fps].Width} Height: ${UIElement[main hud].FindChild[fps].Height}
 
*echo Width: ${UIElement[main hud].FindChild[fps].Width} Height: ${UIElement[main hud].FindChild[fps].Height}
Line 64: Line 64:
 
===Left click an element===
 
===Left click an element===
 
*UIElement[Button Window].FindChild[Exit button]:LeftClick
 
*UIElement[Button Window].FindChild[Exit button]:LeftClick
:left clicks on the "Exit button" child of "Button Window" window
+
:This command left clicks on the "Exit button" child of "Button Window" window
 
===Move an element to 100,150 location===
 
===Move an element to 100,150 location===
 
*UIElement[main hud].FindChild[fps]:SetX[100]
 
*UIElement[main hud].FindChild[fps]:SetX[100]
Line 70: Line 70:
 
===Set an element to always on top===
 
===Set an element to always on top===
 
*UIElement[main hud].FindChild[fps]:SetZOrder[alwaysontop]
 
*UIElement[main hud].FindChild[fps]:SetZOrder[alwaysontop]
 +
:This command sets element "fps" in "main hud" to '''AlwaysOnTop'''
 
== See Also ==
 
== See Also ==
 
* [[ISUI]]
 
* [[ISUI]]

Revision as of 01:04, 31 August 2005

Description

This data type provides and controls data for ISUI elements.

Members

  • string Name: Name of the element
  • int ID: Unique ID number of the element
  • int X: X position relative to its parent
  • int Y: Y position relative to its parent
  • int AbsoluteX: X position relative to the display
  • int AbsoluteY: Y position relative to the display
  • int Width: Width of the element
  • int Height: Height of the element
  • bool Visible: True if the element is visible
  • bool AlwaysOnTop: True if the element is "always on top"
  • bool MouseOver: True if the element has mouse focus
  • bool Focus: True of the element has keyboard focus
  • string Type: Element type (such as "button")
  • ... Parent: Parent element
  • ... Children: First child element (bottom of Z order)
  • ... Next: Next element
  • ... Previous: Previous element
  • ... FindChild[name]: Finds a direct child of this element with the given name
  • ... FindUsableChild[name,type]: Finds a descendant of this element with the given name and element type

Methods

  • LeftClick : left clicks on the element
  • LeftMouseDown : holds left mouse button down on the element
  • LeftMouseUp : releases left mouse button
  • RightClick : right clicks on the element
  • RightMouseDown : holds right mouse button down on the element
  • RightMouseUp : releases right mouse button
  • SetX[#] : sets the elements X to #
  • SetY[#] : sets the elements X to #
  • SetWidth[#] : sets the elements width to #
  • SetHeight[#] : sets the elements height to #
  • SetFocus : sets the keyboard focus to this element (if it can accept it)
  • SetZOrder[how]: choices are alwaysontop, notalwaysontop, moveup, movedown, movetop, movebottom
  • Show : forces the element visible
  • Hide : forces the element invisible
  • ToggleVisible : toggles visibility

Returns

Same as Name

Examples

Get the ID of an element

  • echo Element #: ${UIElement[main hud].ID}
Output
Element #: 2

Toggle an elements visibility

UIElement[main hud].FindChild[fps]:ToggleVisibile

This command toggles fps element on and off

Display an elements width and height

  • echo Width: ${UIElement[main hud].FindChild[fps].Width} Height: ${UIElement[main hud].FindChild[fps].Height}
Output
Width: 20 Height: 12

Display an elements type

  • echo Type: ${UIElement[main hud].FindChild[fps].Type}
Output
Type: hudelement

See if an element is visible

  • echo Visible? ${UIElement[main hud].FindChild[fps].Visible}
Output
Visible? TRUE

Left click an element

  • UIElement[Button Window].FindChild[Exit button]:LeftClick
This command left clicks on the "Exit button" child of "Button Window" window

Move an element to 100,150 location

  • UIElement[main hud].FindChild[fps]:SetX[100]
  • UIElement[main hud].FindChild[fps]:SetY[150]

Set an element to always on top

  • UIElement[main hud].FindChild[fps]:SetZOrder[alwaysontop]
This command sets element "fps" in "main hud" to AlwaysOnTop

See Also