Class: Picture2D

Picture2D

A class for pictures drawable in HUD

new Picture2D (path, x, y, w, h)

Name Type Default Description
path string "" optional The path to the ressource
x number 0 optional Coords of the bitma
y number 0 optional Coords of the bitmap
w number 0 optional Coords of the bitmap
h number 0 optional Coords of the bitmap
Properties:
Name Type Argument Default Description
zoom number <optional>
1.0 The zoom value of the picture
opacity number <optional>
1.0 The opacity value of the picture
angle number <optional>
0.0 The angle value of the picture
cover boolean <optional>
false Indicate if the picture cover the entire canvas
stretch boolean <optional>
false Indicate if the picture is stretched if necessary
path string The path to the ressource
loaded boolean Indicate if the file is loaded
empty boolean Indicate if the file is empty

Extends

Methods

Picture2D.create (picture, x, y, w, h) asyncstatic

Create a picture and then load it
Name Type Default Description
picture SystemPicture The picture to load
x number 0 The x position
y number 0 The y position
w number 0 The w size
h number 0 The h size

Picture2D.createWithID (id, kind, x, y, w, h) asyncstatic

Create a picture from kind and id and then load it
Name Type Default Description
id number The picture id to load
kind PictureKind The picture kind to load
x number 0 The x position
y number 0 The y position
w number 0 The w size
h number 0 The h size

Picture2D.loadImage (path) asyncstatic

Load the image
Name Type Description
path string The image path

load () async

Load the picture and then check

createCopy ()

Create a copy of a picture2D

draw (x, y, w, h, sx, sy, sw, sh, positionResize)

Draw the picture on HUD
Name Type Default Description
x number The x position
y number The y position
w number The w position
h number The h position
sx number 0 optional The source x position
sy number 0 optional The source x position
sw number this.oW optional The source width size
sh number this.oH optional The source height size
positionResize boolean true optional Indicate if the position resize (screen resolution)

setX (x, min) inherited overrides

Set the x value
Name Type Default Description
x number The x value
min boolean false optional If checked, transform screen value with min x y

setY (y, min) inherited overrides

Set the y value
Name Type Default Description
y number The y value
min boolean false optional If checked, transform screen value with min x y

setW (w, min) inherited overrides

Set the w value
Name Type Default Description
w number The w value
min boolean false optional If checked, transform screen value with min x y

setH (h, min) inherited overrides

Set the h value
Name Type Default Description
h number The h value
min boolean false optional If checked, transform screen value with min x y

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