Sprite~ Spritesheet

Spritesheet class

Constructor

new Spritesheet(json)

Spritesheet constructor

Parameters:
NameTypeDescription
jsonObject

Members

file

Getter for the image file

Methods

extract(position, selectoropt, optionsopt) → {Sprite}

Group images from the spritesheet into a single sprite

Parameters:
NameTypeAttributesDefaultDescription
positionPositionDefinition

Position of the sprite

selectorString | function | RegExp<optional>
"*"

Match against the spritesheet images name using a glob pattern, a validation function or a regular expression

optionsImageOptions<optional>

Options of the sprite

Returns:
Type: 
Sprite

get(selectoropt) → {Array}

Return all the frames corresponding to a selector

Parameters:
NameTypeAttributesDefaultDescription
selectorString | function | RegExp<optional>
"*"

Match against the spritesheet images name using a glob pattern, a validation function or a regular expression

Returns:
Type: 
Array