Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:LCDCreateProgressBar

From RoR Wiki

UI Lua API · LCD functions
Version: WAR 1.4.8

Adds a progress bar element to an LCD page.

LCDCreateProgressBar(pageName, barName, style, minimum, maximum)

Arguments

pageName
string – Name of the page.
barName
string – Name of the new element.
style
string – Bar style. The client compares it, ignoring case, with "filled", "cursor" and "dashed".
minimum
number – Lowest value of the bar's range.
maximum
number – Highest value of the bar's range.

Returns

Nothing.

Details

  • minimum and maximum are converted to integers.
  • The new bar starts at minimum and is 160 × 5 pixels. Change the size with LCDSetSize and the value with LCDProgressBarSetProgress.
  • If the page already has an element with this name, nothing is created.
  • If the page does not exist, the error below is logged and nothing is created.
  • The function needs at least five arguments and only reads the last five.

Errors

  • Error in function call 'LCDCreateProgressBar': Page '%s' does not exist.

Example

From ea_lcdkeyboard/source/g15test.lua:

LCDCreateProgressBar( EA_LCDKeyboard.Page1, "HP", "filled", 0, 100 )
LCDSetLocation( EA_LCDKeyboard.Page1, "HP", 30, 0 )
LCDSetSize( EA_LCDKeyboard.Page1, "HP", 130, 9 )

See also