Class: WindowBox

WindowBox

A class for window boxes

new WindowBox (x, y, w, h, opts)

Name Type Default Description
x number The x coords
y number The y coords
w number The w coords
h number The h coords
opts Object {} optional Options
Name Type Default Description
content Bitmap null optional Content (containing a draw function) to display inside the window.
padding Array.<number> [0,0,0,0] optional Padding of the box
limitContent boolean true optional If checked, the content will be cut according to padding
Properties:
Name Type Description
content Bitmap Content (containing a draw function) to display inside the window.
padding Array.<number> Padding of the box
limitContent boolean If checked, the content will be cut according to padding
bordersOpacity number Opacity of borders beetween 0 and 1, default is 1
backgroundOpacity number Opacity of background beetween 0 and 1 , default is 1
selected boolean If checked, the background will change, default is false
bordersVisible boolean If checked, show the borders, default is true
contentDimension Array.<number> Dimension of content
windowDimension Array.<number> Dimensions of the window

Extends

Methods

setX (x) overrides

Set the x value
Name Type Description
x number The x value

setY (y) overrides

Set the y value
Name Type Description
y number The y value

setW (w) overrides

Set the w value
Name Type Description
w number The w value

setH (h) overrides

Set the h value
Name Type Description
h number The h value

updateDimensions ()

Update the content and window dimensions

update ()

Update the content

draw (isChoice, windowDimension, contentDimension)

Draw the window
Name Type Default Description
isChoice boolean false optional Indicate if this window box is used for a window choices.
windowDimension Array.<number> this.windowDimension optional Dimensions of the window
contentDimension Array.<number> this.contentDimension optional Dimension of content

setLeft () inherited overrides

Set the position to the left

setTop () inherited overrides

Set the position to the top

setRight () inherited overrides

Set the position to the right

setBot () inherited overrides

Set the position to the bot

setCoords (x, y, w, h) inherited overrides

Set all the coords values
Name Type Description
x number The x value
y number The y value
w number The w value
h number The h value