Progressbar

Type    

class

[gd]

Inheritance

Progressbar ➝ GroupDisplay ➝ Object


Overview

Creates gauge bar that shows


See also

Group, Display



Syntax


Progressbar(width [,option])


  • width (required : number )  width of the gauge bar


  • option (optional : table) = {

height = n, -- height of the gauge bar (default:width*0.12)

strokeColor = color,   -- border line color (default:Color.WHITE)

strokeWidth = n, -- border line width (default : width/50)

bgColor = color,        -- background color (default : Color.BLACK)

gaugeColor = color, -- gauge color (default  : Color.RED)

min = n,

max = n,


textLocation = 'left' or 'right' or 'top' or 'bottom'

fontSize = n -- font size of value (default: height*1.35)

textMarge = n -- gap between gauage and text in pixel

(default: fontSize*0.5)

fontColor = color -- (default: Color.WHITE)

}


Note: Initial value of the gauge is set to minimum value.


Methods



(getter) method

description

return

obj:getValue()

return current gauge value

number


(setter) method

description

return

obj:setvalue(num)

change the gauge value

obj

obj:setMinMax(m,n)

change the minimum and maxmum value as m and n respectively

obj

obj:setGaugeColor(color)

set color of the gauge as Color object

obj

obj:setStrokeColor(color)

set color of the outline of the gauge bar as Color object

obj

obj:segBgColor(color)

set color of inner area with Color object

obj

obj:setStrokeWidth(n)

change border line width

obj



Examples


local p = Progressbar(200)

p1:setValue(50)


local p=Progressbar(300,{textLocation='right')

p:setMinMax(-100,100)

p:setValue(-50)


댓글 없음:

댓글 쓰기