Spritesheet

Sprite~ Spritesheet

Spritesheet class

Constructor

# new Spritesheet(json)

Spritesheet constructor

Parameters:
Name Type Description
json Object

Members

# file

Getter for the image file

Methods

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

Group images from the spritesheet into a single sprite

Parameters:
Name Type Attributes Default Description
position PositionDefinition

Position of the sprite

selector String | function | RegExp <optional>
"*"

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

options ImageOptions <optional>

Options of the sprite

Returns:
Type
Sprite

# get(selectoropt) → {Array}

Return all the frames corresponding to a selector

Parameters:
Name Type Attributes Default Description
selector String | function | RegExp <optional>
"*"

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

Returns:
Type
Array