Phaser. AnimationParser

new AnimationParser()

Responsible for parsing sprite sheet and JSON data into the internal FrameData format that Phaser uses for animations.

负责分析雪碧表和JSON数据到内部framedata格式,移相器使用动画。

Source - animation/AnimationParser.js, line 13

Methods

<static> JSONData(game, json) → {Phaser.FrameData}

Parse the JSON data and extract the animation frame data from it.

Parameters:
Name Type Description
game Phaser.Game

A reference to the currently running game.

json object

The JSON data from the Texture Atlas. Must be in Array format.

Returns:

A FrameData object containing the parsed frames.

Source - animation/AnimationParser.js, line 93

<static> JSONDataHash(game, json) → {Phaser.FrameData}

Parse the JSON data and extract the animation frame data from it.

Parameters:
Name Type Description
game Phaser.Game

A reference to the currently running game.

json object

The JSON data from the Texture Atlas. Must be in JSON Hash format.

Returns:

A FrameData object containing the parsed frames.

Source - animation/AnimationParser.js, line 203

<static> JSONDataPyxel(game, json) → {Phaser.FrameData}

Parse the JSON data and extract the animation frame data from it.

Parameters:
Name Type Description
game Phaser.Game

A reference to the currently running game.

json object

The JSON data from the Texture Atlas. Must be in Pyxel JSON format.

Returns:

A FrameData object containing the parsed frames.

Source - animation/AnimationParser.js, line 147

<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 - animation/AnimationParser.js, line 15

<static> XMLData(game, xml) → {Phaser.FrameData}

Parse the XML data and extract the animation frame data from it.

Parameters:
Name Type Description
game Phaser.Game

A reference to the currently running game.

xml object

The XML data from the Texture Atlas. Must be in Starling XML format.

Returns:

A FrameData object containing the parsed frames.

Source - animation/AnimationParser.js, line 260
Phaser Copyright © 2012-2015 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.2 on Thu Feb 18 2016 14:40:58 GMT+0000 (GMT Standard Time) using the DocStrap template.

快捷菜单

注意:只有登录才能全文翻译,每个新用户赠送300会员币。
赚取方法:文章评论+1000,分享网站截图给站长+3000,另充10元+100万会员币
支持一下记得截图给站长!

VIP限时免费阅读!登录可得1万币尽情中文阅读!


记得CTRL+D收藏!
站长微信:
支持自学php网
如有问题,记得强刷一下.

  • JSONData(game, json) → {Phaser.FrameData} - 方法
  • JSONDataHash(game, json) → {Phaser.FrameData} - 方法
  • JSONDataPyxel(game, json) → {Phaser.FrameData} - 方法
  • spriteSheet(game, key, frameWidth, frameHeight, frameMax, margin, spacing) → {Phaser.FrameData} - 方法
  • XMLData(game, xml) → {Phaser.FrameData} - 方法