mirror of
https://github.com/wassname/phaser.git
synced 2026-08-17 11:23:42 +08:00
More docs coming on.
This commit is contained in:
@@ -65,6 +65,7 @@ Phaser.AnimationManager.prototype = {
|
||||
* This is called automatically when a new Sprite is created.
|
||||
*
|
||||
* @method loadFrameData
|
||||
* @memberof Phaser.AnimationManager
|
||||
* @private
|
||||
* @param {Phaser.Animation.FrameData} frameData - The FrameData set to load.
|
||||
*/
|
||||
@@ -80,6 +81,7 @@ Phaser.AnimationManager.prototype = {
|
||||
* Animations added in this way are played back with the play function.
|
||||
*
|
||||
* @method add
|
||||
* @memberof Phaser.AnimationManager
|
||||
* @param {string} name - The unique (within this Sprite) name for the animation, i.e. "run", "fire", "walk".
|
||||
* @param {Array} [frames=null] - An array of numbers/strings that correspond to the frames to add to this animation and in which order. e.g. [1, 2, 3] or ['run0', 'run1', run2]). If null then all frames will be used.
|
||||
* @param {number} [frameRate=60] - The speed at which the animation should play. The speed is given in frames per second.
|
||||
@@ -125,6 +127,7 @@ Phaser.AnimationManager.prototype = {
|
||||
* Check whether the frames in the given array are valid and exist.
|
||||
*
|
||||
* @method validateFrames
|
||||
* @memberof Phaser.AnimationManager
|
||||
* @param {Array} frames - An array of frames to be validated.
|
||||
* @param {boolean} [useNumericIndex=true] - Validate the frames based on their numeric index (true) or string index (false)
|
||||
* @return {boolean} True if all given Frames are valid, otherwise false.
|
||||
@@ -160,6 +163,7 @@ Phaser.AnimationManager.prototype = {
|
||||
* If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself.
|
||||
*
|
||||
* @method play
|
||||
* @memberof Phaser.AnimationManager
|
||||
* @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump".
|
||||
* @param {number} [frameRate=null] - The framerate to play the animation at. The speed is given in frames per second. If not provided the previously set frameRate of the Animation is used.
|
||||
* @param {boolean} [loop=null] - Should the animation be looped after playback. If not provided the previously set loop value of the Animation is used.
|
||||
@@ -190,6 +194,7 @@ Phaser.AnimationManager.prototype = {
|
||||
* The currentAnim property of the AnimationManager is automatically set to the animation given.
|
||||
*
|
||||
* @method stop
|
||||
* @memberof Phaser.AnimationManager
|
||||
* @param {string} [name=null] - The name of the animation to be stopped, e.g. "fire". If none is given the currently running animation is stopped.
|
||||
* @param {boolean} [resetFrame=false] - When the animation is stopped should the currentFrame be set to the first frame of the animation (true) or paused on the last frame displayed (false)
|
||||
*/
|
||||
@@ -219,6 +224,7 @@ Phaser.AnimationManager.prototype = {
|
||||
* The main update function is called by the Sprites update loop. It's responsible for updating animation frames and firing related events.
|
||||
*
|
||||
* @method update
|
||||
* @memberof Phaser.AnimationManager
|
||||
* @protected
|
||||
* @return {boolean} True if a new animation frame has been set, otherwise false.
|
||||
*/
|
||||
@@ -244,6 +250,7 @@ Phaser.AnimationManager.prototype = {
|
||||
* Destroys all references this AnimationManager contains. Sets the _anims to a new object and nulls the current animation.
|
||||
*
|
||||
* @method destroy
|
||||
* @memberof Phaser.AnimationManager
|
||||
*/
|
||||
destroy: function () {
|
||||
|
||||
@@ -258,6 +265,7 @@ Phaser.AnimationManager.prototype = {
|
||||
};
|
||||
|
||||
/**
|
||||
* @memberof Phaser.AnimationManager
|
||||
* @return {Phaser.Animation.FrameData} Returns the FrameData of the current animation.
|
||||
*/
|
||||
Object.defineProperty(Phaser.AnimationManager.prototype, "frameData", {
|
||||
@@ -269,6 +277,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, "frameData", {
|
||||
});
|
||||
|
||||
/**
|
||||
* @memberof Phaser.AnimationManager
|
||||
* @return {number} Returns the total number of frames in the loaded FrameData, or -1 if no FrameData is loaded.
|
||||
*/
|
||||
Object.defineProperty(Phaser.AnimationManager.prototype, "frameTotal", {
|
||||
@@ -288,8 +297,10 @@ Object.defineProperty(Phaser.AnimationManager.prototype, "frameTotal", {
|
||||
});
|
||||
|
||||
/**
|
||||
* @memberof Phaser.AnimationManager
|
||||
* @return {boolean} Returns the paused state of the current animation.
|
||||
*//**
|
||||
* @memberof Phaser.AnimationManager
|
||||
* @param {boolean} value - Sets the paused state of the current animation.
|
||||
*/
|
||||
Object.defineProperty(Phaser.AnimationManager.prototype, "paused", {
|
||||
@@ -309,8 +320,10 @@ Object.defineProperty(Phaser.AnimationManager.prototype, "paused", {
|
||||
});
|
||||
|
||||
/**
|
||||
* @memberof Phaser.AnimationManager
|
||||
* @return {number} Returns the index of the current frame.
|
||||
*//**
|
||||
* @memberof Phaser.AnimationManager
|
||||
* @param {number} value - Sets the current frame on the Sprite and updates the texture cache for display.
|
||||
*/
|
||||
Object.defineProperty(Phaser.AnimationManager.prototype, "frame", {
|
||||
@@ -339,8 +352,10 @@ Object.defineProperty(Phaser.AnimationManager.prototype, "frame", {
|
||||
});
|
||||
|
||||
/**
|
||||
* @memberof Phaser.AnimationManager
|
||||
* @return {string} Returns the name of the current frame if it has one.
|
||||
*//**
|
||||
* @memberof Phaser.AnimationManager
|
||||
* @param {string} value - Sets the current frame on the Sprite and updates the texture cache for display.
|
||||
*/
|
||||
Object.defineProperty(Phaser.AnimationManager.prototype, "frameName", {
|
||||
|
||||
Reference in New Issue
Block a user