API:LCDProgressBarSetProgress
From RoR Wiki
UI Lua API · LCD functions
Version: WAR 1.4.8
Sets the value of an LCD progress bar.
LCDProgressBarSetProgress(pageName, barName, value)
Arguments
- pageName
string– Name of the page.- barName
string– Name of a progress bar created with LCDCreateProgressBar.- value
number– New value, within the range given at creation.
Returns
Nothing.
Details
- The value is passed to the bar as a single-precision float.
- The function needs at least three arguments and only reads the last three.
Errors
Error in function call 'LCDProgressBarSetProgress': Page '%s' does not exist.Error in function call 'LCDProgressBarSetProgress': Page '%s' does not have a child named '%s'.Error in function call 'LCDProgressBarSetProgress': '%s' on page '%s' is not a/an ProgressBar.
Example
From ea_lcdkeyboard/source/g15test.lua, where the bar was created with the range 0–100:
function EA_LCDKeyboard.UpdateHP() local percent = GameData.Player.hitPoints.current / GameData.Player.hitPoints.maximum * 100 LCDProgressBarSetProgress( EA_LCDKeyboard.Page1, "HP", percent ) end
