AnimationParser.spriteSheet()

<static> spriteSheet(game, key, frameWidth, frameHeight, frameMax, margin, spacing) → {Phaser.FrameData}

Parse a Sprite Sheet and extract the animation frame data from it.

Parameters
Name Type Argument Default Description
game Phaser.Game

A reference to the currently running game.

key string | Image

The Game.Cache asset key of the Sprite Sheet image or an actual HTML Image element.

frameWidth number

The fixed width of each frame of the animation.

frameHeight number

The fixed height of each frame of the animation.

frameMax number <optional>
-1

The total number of animation frames to extract from the Sprite Sheet. The default value of -1 means "extract all frames".

margin number <optional>
0

If the frames have been drawn with a margin, specify the amount here.

spacing number <optional>
0

If the frames have been drawn with spacing between them, specify the amount here.

Returns

A FrameData object containing the parsed frames.

Source code: animation/AnimationParser.js (Line 15)
doc_phaser
2017-02-14 10:36:09
Comments
Leave a Comment

Please login to continue.