Class: SystemPicture

SystemPicture

A picture of the game

new SystemPicture (json, kind)

Name Type Default Description
json Object optional Json object describing the picture
kind Object PictureKind.Pictures optional The kind of picture
Properties:
Name Type Description
kind PictureKind The kind of picture
name string The picture name
isBR boolean Indicate if the picture is a BR (Basic Ressource)
isDLC boolean Indicate if the picture is a DLC
jsonCollisions Array.<number> The json used for the picture collision
collisionsRepeat boolean Indicate if collision is repeated (for characters)
collisions Array.<CollisionSquare> The collisions squares

Members

getFolder

Get the folder associated to a kind of picture

getLocalFolder

Get the local folder associated to a kind of picture

Methods

read (json)

Read the JSON associated to the picture
Name Type Description
json Object Json object describing the picture

load () async

Read the JSON associated to the picture

getPath ()string

Get the absolute path associated to this picture
Returns:
Type Description
string

readCollisionsImage (image)

Read collisions according to image size
Name Type Description
image Image The image texture

readCollisions ()

Read collisions, we assume that this.width and this.height had been edited

getCollisionAt (pos)CollisionSquare

Get a specific collision square according to texture
Name Type Description
pos Array.<number> Texture position
Returns:
Type Description
CollisionSquare

getCollisionAtPos (x, y)CollisionSquare

Get a specific collision square according to texture
Name Type Description
x number Texture x position
y number Texture y position
Returns:
Type Description
CollisionSquare

getCollisionAtIndex (index)CollisionSquare

Get a specific collision square according to index
Name Type Description
index number The index positions
Returns:
Type Description
CollisionSquare

getSquaresForWall (texture)Array.<Array.<number>>

Get a specific collision for wall
Name Type Description
texture Array.<number> Texture position
Returns:
Type Description
Array.<Array.<number>>

getSquaresForTexture (texture)Array.<Array.<number>>

Get a specific collision square according to texture
Name Type Description
texture Array.<number> Texture position
Returns:
Type Description
Array.<Array.<number>>

getSquaresForStates (image)Array.<Array.<Array.<number>>>

Get a specific collision square according to texture
Name Type Description
image Image The image texture
Returns:
Type Description
Array.<Array.<Array.<number>>>