Factioncontroltemplate3

From Vendetta Lua
Jump to navigationJump to search

factioncontroltemplate3 creates a container with a progressbar.

Functions

Set

Definition:
Set(userdata box, string name, text1, text2, value, color, int min, max) -> nil

Description:
Change values of progressbar

Arguments:
box this box
name name of the progressbar (label to the left)
text1 text to overlay over the progressbar
text2 text to overlay on mouseover
value position of bar. between min and max
color iup color of bar
min minimum value
max maximum value

Setup

Definition:
Setup(userdata box, string name, text1, text2, value, color, int min, max) -> nil

Description:
Wrapper around Set that sets the bar to the given faction standing

Arguments:
box this box
name name of the progressbar (label to the left)
standing faction standing (0-65535)

Example

<source lang="lua"> -- simple faction progressbar example

-- function that prints something whenever the bar is clicked local function click_cb()

   print("Click!")

end

local c = factioncontroltemplate3(iup.stationsubframe, click_cb) local d = iup.dialog{c, topmost="yes"}

-- sets the bar to red and 50% c:Set("Bla", "Off", "On", 1000, "255 0 0", 0, 2000)

-- sets the bar to "Hate" -- c:Setup("Bla", 1000)

d:show() </source>