static
Class SpriteSheetUtils
static
Image
extractFrame
(
spriteSheet
,
frame
)
spriteSheet
<Image>
The SpriteSheet instance to extract a frame from.
frame
<Number>
The frame number or animation name to extract. If an animation
name is specified, only the first frame of the animation will be extracted.
Image
static
void
flip
(
spriteSheet
,
flipData
)
spriteSheet
<Image>
The sprite sheet to use as the source.
flipData
<Object>
A generic object that specifies which frames will be flipped, what to name the
flipped result, and how to flip the frames (horizontally, vertically, or both). Each property name
indicates the name of a new sequence to create, and should reference an array where the first index is
the name of the original sequence to flip, the second index indicates whether to flip it horizontally,
the third index indicates whether to flip it vertically, and the fourth indicates what the "next" value
for the resulting frame data should be. For example, the following would create a new sequence named
"walk_left" consisting of the frames from the original "walk_right" sequence flipped
horizontally: {walk_left: ["walk_right", true, false]}
void