Difference between revisions of "LavishGUI:lguihudelement (Data Type)"
Jump to navigation
Jump to search
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 | + | *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 | + | *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 | + | *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 | + | *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 | + | *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 | + | *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 | + | *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 == |
Revision as of 21:37, 10 October 2006
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
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