API:StatusBarSetCurrentValue
From RoR Wiki
UI Lua API · StatusBar functions
Version: WAR 1.4.8
Sets the current value of a StatusBar.
StatusBarSetCurrentValue(barName, value)
Arguments
- barName
string– Name of a StatusBar window.- value
number– The new value.
Returns
Nothing.
Details
- The bar's fill is
value / maximumof its width (see StatusBarSetMaximumValue). For drawing, the value is limited to the range 0 to maximum; the stored value is not changed. - If the bar has
interpolate="true"in XML, the fill moves towards the new value over the following frames instead of jumping. StatusBarStopInterpolating makes it jump at once. - With a maximum of 0 the fill is empty.
- The function needs at least two arguments and only reads the last two.
- The error is the same when the window does not exist and when it is not a StatusBar.
Errors
Error in function call 'StatusBarSetCurrentValue': StatusBar %s does not exist.
Example
Using a 0–1 bar, from easystem_utils/source/datautils.lua:
StatusBarSetMaximumValue( barName, 1.0 ) StatusBarSetCurrentValue( barName, statusBarPercent )
