new AnimationParser()
Responsible for parsing sprite sheet and JSON data into the internal FrameData format that Phaser uses for animations.
- Source:
Methods
-
<static> JSONData(game, json, cacheKey) → {Phaser.FrameData}
-
Parse the JSON data and extract the animation frame data from it.
Parameters:
Name Type Description gamePhaser.Game A reference to the currently running game.
jsonObject The JSON data from the Texture Atlas. Must be in Array format.
cacheKeystring The Game.Cache asset key of the texture image.
- Source:
Returns:
A FrameData object containing the parsed frames.
- Type
- Phaser.FrameData
-
<static> JSONDataHash(game, json, cacheKey) → {Phaser.FrameData}
-
Parse the JSON data and extract the animation frame data from it.
Parameters:
Name Type Description gamePhaser.Game A reference to the currently running game.
jsonObject The JSON data from the Texture Atlas. Must be in JSON Hash format.
cacheKeystring The Game.Cache asset key of the texture image.
- Source:
Returns:
A FrameData object containing the parsed frames.
- Type
- Phaser.FrameData
-
<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 gamePhaser.Game A reference to the currently running game.
keystring The Game.Cache asset key of the Sprite Sheet image.
frameWidthnumber The fixed width of each frame of the animation.
frameHeightnumber The fixed height of each frame of the animation.
frameMaxnumber <optional>
-1 The total number of animation frames to extact from the Sprite Sheet. The default value of -1 means "extract all frames".
marginnumber <optional>
0 If the frames have been drawn with a margin, specify the amount here.
spacingnumber <optional>
0 If the frames have been drawn with spacing between them, specify the amount here.
- Source:
Returns:
A FrameData object containing the parsed frames.
- Type
- Phaser.FrameData
-
<static> XMLData(game, xml, cacheKey) → {Phaser.FrameData}
-
Parse the XML data and extract the animation frame data from it.
Parameters:
Name Type Description gamePhaser.Game A reference to the currently running game.
xmlObject The XML data from the Texture Atlas. Must be in Starling XML format.
cacheKeystring The Game.Cache asset key of the texture image.
- Source:
Returns:
A FrameData object containing the parsed frames.
- Type
- Phaser.FrameData