mirror of
https://github.com/photonstorm/phaser
synced 2024-12-22 02:53:27 +00:00
1 line
No EOL
14 KiB
JSON
1 line
No EOL
14 KiB
JSON
{"class":{"name":"Phaser.Animation","extends":"","static":false,"constructor":true,"parameters":[{"name":"game","type":["Phaser.Game"],"help":"A reference to the currently running game.","optional":false,"default":null},{"name":"parent","type":["Phaser.Sprite"],"help":"A reference to the owner of this Animation.","optional":false,"default":null},{"name":"name","type":["string"],"help":"The unique name for this animation, used in playback commands.","optional":false,"default":null},{"name":"frameData","type":["Phaser.FrameData"],"help":"The FrameData object that contains all frames used by this Animation.","optional":false,"default":null},{"name":"frames","type":["array number","array string"],"help":"An array of numbers or strings indicating which frames to play in which order.","optional":false,"default":null},{"name":"frameRate","type":["number"],"help":"The speed at which the animation should play. The speed is given in frames per second.","optional":true,"default":"60"},{"name":"loop","type":["boolean"],"help":"Whether or not the animation is looped or just plays once.","optional":true,"default":"false"},{"name":"loop","type":["boolean"],"help":"Should this animation loop when it reaches the end or play through once.","optional":false,"default":null}],"help":"An Animation instance contains a single animation and the controls to play it.\\nIt is created by the AnimationManager, consists of Animation.Frame objects and belongs to a single Game Object such as a Sprite."},"consts":[],"methods":{"public":[{"name":"complete","static":false,"returns":null,"help":"Called internally when the animation finishes playback.\\nSets the isPlaying and isFinished states and dispatches the onAnimationComplete event if it exists on the parent and local onComplete event.","line":575,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"destroy","static":false,"returns":null,"help":"Cleans up this animation ready for deletion. Nulls all values and references.","line":546,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"generateFrameNames","static":true,"returns":{"types":["array"],"help":"An array of framenames."},"help":"Really handy function for when you are creating arrays of animation data but it's using frame names and not numbers.\\nFor example imagine you've got 30 frames named: 'explosion_0001-large' to 'explosion_0030-large'\\nYou could use this function to generate those by doing: Phaser.Animation.generateFrameNames('explosion_', 1, 30, '-large', 4);","line":746,"public":true,"protected":false,"private":false,"parameters":[{"name":"prefix","type":["string"],"help":"The start of the filename. If the filename was 'explosion_0001-large' the prefix would be 'explosion_'.","optional":false,"default":null},{"name":"start","type":["number"],"help":"The number to start sequentially counting from. If your frames are named 'explosion_0001' to 'explosion_0034' the start is 1.","optional":false,"default":null},{"name":"stop","type":["number"],"help":"The number to count to. If your frames are named 'explosion_0001' to 'explosion_0034' the stop value is 34.","optional":false,"default":null},{"name":"suffix","type":["string"],"help":"The end of the filename. If the filename was 'explosion_0001-large' the prefix would be '-large'.","optional":true,"default":"''"},{"name":"zeroPad","type":["number"],"help":"The number of zeroes to pad the min and max values with. If your frames are named 'explosion_0001' to 'explosion_0034' then the zeroPad is 4.","optional":true,"default":"0"}],"inherited":false,"inheritedFrom":""},{"name":"next","static":false,"returns":null,"help":"Advances by the given number of frames in the Animation, taking the loop value into consideration.","line":436,"public":true,"protected":false,"private":false,"parameters":[{"name":"quantity","type":["number"],"help":"The number of frames to advance.","optional":true,"default":"1"}],"inherited":false,"inheritedFrom":""},{"name":"onPause","static":false,"returns":null,"help":"Called when the Game enters a paused state.","line":333,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"onResume","static":false,"returns":null,"help":"Called when the Game resumes from a paused state.","line":347,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"play","static":false,"returns":{"types":["Phaser.Animation"],"help":"- A reference to this Animation instance."},"help":"Plays this animation.","line":165,"public":true,"protected":false,"private":false,"parameters":[{"name":"frameRate","type":["number"],"help":"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.","optional":true,"default":"null"},{"name":"loop","type":["boolean"],"help":"Should the animation be looped after playback. If not provided the previously set loop value of the Animation is used.","optional":true,"default":"false"},{"name":"killOnComplete","type":["boolean"],"help":"If set to true when the animation completes (only happens if loop=false) the parent Sprite will be killed.","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"previous","static":false,"returns":null,"help":"Moves backwards the given number of frames in the Animation, taking the loop value into consideration.","line":485,"public":true,"protected":false,"private":false,"parameters":[{"name":"quantity","type":["number"],"help":"The number of frames to move back.","optional":true,"default":"1"}],"inherited":false,"inheritedFrom":""},{"name":"restart","static":false,"returns":null,"help":"Sets this animation back to the first frame and restarts the animation.","line":219,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"setFrame","static":false,"returns":null,"help":"Sets this animations playback to a given frame with the given ID.","line":246,"public":true,"protected":false,"private":false,"parameters":[{"name":"frameId","type":["string","number"],"help":"The identifier of the frame to set. Can be the name of the frame, the sprite index of the frame, or the animation-local frame index.","optional":true,"default":null},{"name":"useLocalFrameIndex","type":["boolean"],"help":"If you provide a number for frameId, should it use the numeric indexes of the frameData, or the 0-indexed frame index local to the animation.","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"stop","static":false,"returns":null,"help":"Stops playback of this animation and set it to a finished state. If a resetFrame is provided it will stop playback and set frame to the first in the animation.\\nIf `dispatchComplete` is true it will dispatch the complete events, otherwise they'll be ignored.","line":305,"public":true,"protected":false,"private":false,"parameters":[{"name":"resetFrame","type":["boolean"],"help":"If true after the animation stops the currentFrame value will be set to the first frame in this animation.","optional":true,"default":"false"},{"name":"dispatchComplete","type":["boolean"],"help":"Dispatch the Animation.onComplete and parent.onAnimationComplete events?","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"update","static":false,"returns":null,"help":"Updates this animation. Called automatically by the AnimationManager.","line":361,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"updateFrameData","static":false,"returns":null,"help":"Changes the FrameData object this Animation is using.","line":534,"public":true,"protected":false,"private":false,"parameters":[{"name":"frameData","type":["Phaser.FrameData"],"help":"The FrameData object that contains all frames used by this Animation.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""}],"protected":[],"private":[],"static":[]},"properties":{"public":[{"name":"currentFrame","type":["Phaser.Frame"],"help":"","inlineHelp":"The currently displayed frame of the Animation.","line":125,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"delay","type":["number"],"help":"","inlineHelp":"The delay in ms between each frame of the Animation, based on the given frameRate.","line":58,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"enableUpdate","type":["boolean"],"help":"","inlineHelp":"Gets or sets if this animation will dispatch the onUpdate events upon changing frame.","line":708,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"frame","type":["number"],"help":"","inlineHelp":"Gets or sets the current frame index and updates the Texture Cache for display.","line":647,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"frameTotal","type":["number"],"help":"","inlineHelp":"The total number of frames in the currently loaded FrameData, or -1 if no FrameData is loaded.","line":635,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"game","type":["Phaser.Game"],"help":"","inlineHelp":"A reference to the currently running Game.","line":29,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"isFinished","type":["boolean"],"help":"","inlineHelp":"The finished state of the Animation. Set to true once playback completes, false during playback.","line":80,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"isPaused","type":["boolean"],"help":"","inlineHelp":"The paused state of the Animation.","line":92,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"isPlaying","type":["boolean"],"help":"","inlineHelp":"The playing state of the Animation. Set to false once playback completes, true during playback.","line":86,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"killOnComplete","type":["boolean"],"help":"","inlineHelp":"Should the parent of this Animation be killed when the animation completes?","line":74,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"loop","type":["boolean"],"help":"","inlineHelp":"The loop state of the Animation.","line":63,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"loopCount","type":["number"],"help":"","inlineHelp":"The number of times the animation has looped since it was last started.","line":68,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"name","type":["string"],"help":"","inlineHelp":"The user defined name given to this Animation.","line":46,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onComplete","type":["Phaser.Signal"],"help":"","inlineHelp":"This event is dispatched when this Animation completes playback. If the animation is set to loop this is never fired, listen for onAnimationLoop instead.","line":141,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onLoop","type":["Phaser.Signal"],"help":"","inlineHelp":"This event is dispatched when this Animation loops.","line":146,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onStart","type":["Phaser.Signal"],"help":"","inlineHelp":"This event is dispatched when this Animation starts playback.","line":130,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onUpdate","type":["Phaser.Signal","null"],"help":"","inlineHelp":"This event is dispatched when the Animation changes frame. By default this event is disabled due to its intensive nature. Enable it with: `Animation.enableUpdate = true`.","line":136,"default":"null","public":true,"protected":false,"private":false,"readOnly":false},{"name":"paused","type":["boolean"],"help":"","inlineHelp":"Gets and sets the paused state of this Animation.","line":600,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"speed","type":["number"],"help":"","inlineHelp":"Gets or sets the current speed of the animation in frames per second. Changing this in a playing animation will take effect from the next frame. Minimum value is 1.","line":685,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[{"name":"_frameData","type":["Phaser.FrameData"],"help":"","inlineHelp":"The FrameData the Animation uses.","line":41,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_frameDiff","type":["number"],"help":"","inlineHelp":"","line":113,"default":"0","public":false,"protected":false,"private":true,"readOnly":false},{"name":"_frameIndex","type":["number"],"help":"","inlineHelp":"","line":106,"default":"0","public":false,"protected":false,"private":true,"readOnly":false},{"name":"_frameSkip","type":["number"],"help":"","inlineHelp":"","line":120,"default":"1","public":false,"protected":false,"private":true,"readOnly":false},{"name":"_frames","type":["array"],"help":"","inlineHelp":"","line":52,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_parent","type":["Phaser.Sprite"],"help":"","inlineHelp":"A reference to the parent Sprite that owns this Animation.","line":35,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_pauseStartTime","type":["boolean"],"help":"","inlineHelp":"The time the animation paused.","line":99,"default":"0","public":false,"protected":false,"private":true,"readOnly":false}]}} |