Difference between revisions of "LavishGUI:lguihudelement (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 LGUI HUD elements.
+
This data type provides and controls data for [[LavishGUI:hudelement_%28Element_Type%29|hudelement (Element Type)]].
 
== Members ==
 
== Members ==
 
* [[DataType:string|string]] '''Text''' :  text of the HUD element
 
* [[DataType:string|string]] '''Text''' :  text of the HUD element
Line 45: Line 45:
 
== See Also ==
 
== See Also ==
 
* [[LavishGUI]]
 
* [[LavishGUI]]
 +
* [[LavishGUI:hudelement_%28Element_Type%29|hudelement (Element Type)]]
 
* [[LavishScript:Data Types|LavishScript Data Types]]
 
* [[LavishScript:Data Types|LavishScript Data Types]]
 
* [[IS:Session#Data_Types|Inner Space Session Data Types]]
 
* [[IS:Session#Data_Types|Inner Space Session Data Types]]
  
 
[[Category:LavishGUI]]
 
[[Category:LavishGUI]]

Revision as of 22:53, 15 December 2005

Description

This data type provides and controls data for hudelement (Element Type).

Members

  • string Text : text of the HUD element
  • string Group : name of the HUD group the element belongs to
  • isuifont Font : font the HUD element is written in
  • int UpdateInterval : how many frames inbetween updating the element

Methods

  • SetText[text] : sets the elements text to <text>
  • SetGroup[text] : sets the elements HUD group to <text>
  • SetUpdateInterval[#] : set the elements update interval to <#>

Inherits

lguielement

Returns

Same as lguielement.Name

Examples

Display a HUD element's text

  • echo HUD element text: ${UIElement[main hud].FindChild[fps].Text}
Output
HUD element text: FPS: 14.14

Display a HUD element's group

  • echo HUD element group: ${UIElement[main hud].FindChild[fps].Group}
Output
HUD element group: FPS Indicator

Display a HUD element's font

  • echo HUD element font: ${UIElement[main hud].FindChild[fps].Font}
Output
HUD element font: Terminal

Display a HUD element's HUD interval

  • echo HUD element UpdateInterval: ${UIElement[main hud].FindChild[fps].UpdateInterval}
Output
HUD element UpdateInterval: 4

Set HUD element text

  • UIElement[main hud].FindChild[fps]:SetText[FPS \${Display.FPS}]
Note: without the \ before ${Display.FPS} it will parse the result and you will end up with a constant value instead of updating the FPS continually

Set HUD element group

  • UIElement[main hud].FindChild[fps]:SetGroup[New FPS Group]
This command will change the hud element "FPS" from "FPS Indicator" group to "New FPS Group"

Set HUD element update interval

  • UIElement[main hud].FindChild[fps]:SetUpdateInterval[2]
This command sets the "fps" element to update every 2 frames

See Also