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

From Lavish Software Wiki
Jump to navigation Jump to search
 
(3 intermediate revisions by 3 users not shown)
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
 
* [[DataType:string|string]] '''Group''' :  name of the HUD group the element belongs to
 
* [[DataType:string|string]] '''Group''' :  name of the HUD group the element belongs to
* [[ISSession:isuifont (Data Type)|isuifont]] '''Font''' :  font the HUD element is written in
+
* [[LavishGUI:lguifont (Data Type)|lguifontfont]] '''Font''' :  font the HUD element is written in
 
* [[DataType:int|int]] '''UpdateInterval''' :  how many frames inbetween updating the element
 
* [[DataType:int|int]] '''UpdateInterval''' :  how many frames inbetween updating the element
 
== Methods ==
 
== Methods ==
Line 19: Line 19:
 
== Examples ==
 
== Examples ==
 
===Display a HUD element's text===
 
===Display a HUD element's text===
*echo HUD element text: ${UIElement[main hud].FindChild[fps].Text}
+
*echo HUD element text: ${UIElement[fps@main hud].Text}
 
;Output
 
;Output
 
  HUD element text: FPS: 14.14
 
  HUD element text: FPS: 14.14
 
===Display a HUD element's group===
 
===Display a HUD element's group===
*echo HUD element group: ${UIElement[main hud].FindChild[fps].Group}
+
*echo HUD element group: ${UIElement[fps@main hud].Group}
 
;Output
 
;Output
 
  HUD element group: FPS Indicator
 
  HUD element group: FPS Indicator
 
===Display a HUD element's font===
 
===Display a HUD element's font===
*echo HUD element font: ${UIElement[main hud].FindChild[fps].Font}
+
*echo HUD element font: ${UIElement[fps@main hud].Font}
 
;Output
 
;Output
 
  HUD element font: Terminal
 
  HUD element font: Terminal
 
===Display a HUD element's HUD interval===
 
===Display a HUD element's HUD interval===
*echo HUD element UpdateInterval: ${UIElement[main hud].FindChild[fps].UpdateInterval}
+
*echo HUD element UpdateInterval: ${UIElement[fps@main hud].UpdateInterval}
 
;Output
 
;Output
 
  HUD element UpdateInterval: 4
 
  HUD element UpdateInterval: 4
 
===Set HUD element text===
 
===Set HUD element text===
*UIElement[main hud].FindChild[fps]:SetText[FPS \${Display.FPS}]
+
*UIElement[fps@main hud]: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
 
:'''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===
 
===Set HUD element group===
*UIElement[main hud].FindChild[fps]:SetGroup[New FPS Group]
+
*UIElement[fps@main hud]:SetGroup[New FPS Group]
 
:This command will change the hud element "FPS" from "FPS Indicator" group to "New FPS Group"
 
:This command will change the hud element "FPS" from "FPS Indicator" group to "New FPS Group"
 
===Set HUD element update interval===
 
===Set HUD element update interval===
*UIElement[main hud].FindChild[fps]:SetUpdateInterval[2]
+
*UIElement[fps@main hud]:SetUpdateInterval[2]
 
:This command sets the "fps" element to update every 2 frames
 
:This command sets the "fps" element to update every 2 frames
 
== 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]]

Latest revision as of 09:13, 4 April 2007

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
  • lguifontfont 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[fps@main hud].Text}
Output
HUD element text: FPS: 14.14

Display a HUD element's group

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

Display a HUD element's font

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

Display a HUD element's HUD interval

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

Set HUD element text

  • UIElement[fps@main hud]: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[fps@main hud]: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[fps@main hud]:SetUpdateInterval[2]
This command sets the "fps" element to update every 2 frames

See Also