mirror of
https://github.com/photonstorm/phaser
synced 2024-12-19 09:34:02 +00:00
1 line
No EOL
11 KiB
JSON
Executable file
1 line
No EOL
11 KiB
JSON
Executable file
{"class":{"name":"Phaser.AnimationManager","extends":"","static":false,"constructor":true,"parameters":[{"name":"sprite","type":["Phaser.Sprite"],"help":"A reference to the Game Object that owns this AnimationManager.","optional":false,"default":null}],"help":"The Animation Manager is used to add, play and update Phaser Animations.\\nAny Game Object such as Phaser.Sprite that supports animation contains a single AnimationManager instance."},"consts":[],"methods":{"public":[{"name":"add","static":false,"returns":{"types":["Phaser.Animation"],"help":"The Animation object that was created."},"help":"Adds a new animation under the given key. Optionally set the frames, frame rate and loop.\\nAnimations added in this way are played back with the play function.","line":179,"public":true,"protected":false,"private":false,"parameters":[{"name":"name","type":["string"],"help":"The unique (within this Sprite) name for the animation, i.e. \"run\", \"fire\", \"walk\".","optional":false,"default":null},{"name":"frames","type":["array"],"help":"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.","optional":true,"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":"useNumericIndex","type":["boolean"],"help":"Are the given frames using numeric indexes (default) or strings?","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""},{"name":"destroy","static":false,"returns":null,"help":"Destroys all references this AnimationManager contains.\\nIterates through the list of animations stored in this manager and calls destroy on each of them.","line":434,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"getAnimation","static":false,"returns":{"types":["Phaser.Animation"],"help":"The Animation instance, if found, otherwise null."},"help":"Returns an animation that was previously added by name.","line":397,"public":true,"protected":false,"private":false,"parameters":[{"name":"name","type":["string"],"help":"The name of the animation to be returned, e.g. \"fire\".","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"next","static":false,"returns":null,"help":"Advances by the given number of frames in the current animation, taking the loop value into consideration.","line":364,"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":"play","static":false,"returns":{"types":["Phaser.Animation"],"help":"A reference to playing Animation instance."},"help":"Play an animation based on the given key. The animation should previously have been added via sprite.animations.add()\\nIf 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.","line":275,"public":true,"protected":false,"private":false,"parameters":[{"name":"name","type":["string"],"help":"The name of the animation to be played, e.g. \"fire\", \"walk\", \"jump\".","optional":false,"default":null},{"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 current animation, taking the loop value into consideration.","line":380,"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":"refreshFrame","static":false,"returns":null,"help":"Refreshes the current frame data back to the parent Sprite and also resets the texture data.","line":416,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"stop","static":false,"returns":null,"help":"Stop playback of an animation. If a name is given that specific animation is stopped, otherwise the current animation is stopped.\\nThe currentAnim property of the AnimationManager is automatically set to the animation given.","line":312,"public":true,"protected":false,"private":false,"parameters":[{"name":"name","type":["string"],"help":"The name of the animation to be stopped, e.g. \"fire\". If none is given the currently running animation is stopped.","optional":true,"default":"null"},{"name":"resetFrame","type":["boolean"],"help":"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)","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"validateFrames","static":false,"returns":{"types":["boolean"],"help":"True if all given Frames are valid, otherwise false."},"help":"Check whether the frames in the given array are valid and exist.","line":238,"public":true,"protected":false,"private":false,"parameters":[{"name":"frames","type":["array"],"help":"An array of frames to be validated.","optional":false,"default":null},{"name":"useNumericIndex","type":["boolean"],"help":"Validate the frames based on their numeric index (true) or string index (false)","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""}],"protected":[{"name":"update","static":false,"returns":{"types":["boolean"],"help":"True if a new animation frame has been set, otherwise false."},"help":"The main update function is called by the Sprites update loop. It's responsible for updating animation frames and firing related events.","line":341,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""}],"private":[{"name":"copyFrameData","static":false,"returns":{"types":["boolean"],"help":"Returns `true` if the frame data was loaded successfully, otherwise `false`"},"help":"Loads FrameData into the internal temporary vars and resets the frame index to zero.\\nThis is called automatically when a new Sprite is created.","line":133,"public":false,"protected":false,"private":true,"parameters":[{"name":"frameData","type":["Phaser.FrameData"],"help":"The FrameData set to load.","optional":false,"default":null},{"name":"frame","type":["string","number"],"help":"The frame to default to.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"loadFrameData","static":false,"returns":{"types":["boolean"],"help":"Returns `true` if the frame data was loaded successfully, otherwise `false`"},"help":"Loads FrameData into the internal temporary vars and resets the frame index to zero.\\nThis is called automatically when a new Sprite is created.","line":84,"public":false,"protected":false,"private":true,"parameters":[{"name":"frameData","type":["Phaser.FrameData"],"help":"The FrameData set to load.","optional":false,"default":null},{"name":"frame","type":["string","number"],"help":"The frame to default to.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""}],"static":[]},"properties":{"public":[{"name":"currentAnim","type":["Phaser.Animation"],"help":"","inlineHelp":"The currently displayed animation, if any.","line":37,"default":"null","public":true,"protected":false,"private":false,"readOnly":false},{"name":"currentFrame","type":["Phaser.Frame"],"help":"","inlineHelp":"The currently displayed Frame of animation, if any.","line":31,"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":526,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"frameData","type":["Phaser.FrameData"],"help":"","inlineHelp":"The current animations FrameData.","line":463,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"frameName","type":["string"],"help":"","inlineHelp":"Gets or sets the current frame name and updates the Texture Cache for display.","line":565,"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":476,"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":25,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"isLoaded","type":["boolean"],"help":"","inlineHelp":"Set to true once animation data has been loaded.","line":49,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"name","type":["string"],"help":"","inlineHelp":"Gets the current animation name, if set.","line":509,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"paused","type":["boolean"],"help":"","inlineHelp":"Gets and sets the paused state of the current animation.","line":489,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"sprite","type":["Phaser.Sprite"],"help":"","inlineHelp":"A reference to the parent Sprite that owns this AnimationManager.","line":20,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"updateIfVisible","type":["boolean"],"help":"","inlineHelp":"Should the animation data continue to update even if the Sprite.visible is set to false.","line":43,"default":"true","public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[{"name":"_anims","type":["object"],"help":"","inlineHelp":"An internal object that stores all of the Animation instances.","line":62,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_frameData","type":["Phaser.FrameData"],"help":"","inlineHelp":"A temp. var for holding the currently playing Animations FrameData.","line":56,"default":"null","public":false,"protected":false,"private":true,"readOnly":false},{"name":"_outputFrames","type":["object"],"help":"","inlineHelp":"An internal object to help avoid gc.","line":68,"default":null,"public":false,"protected":false,"private":true,"readOnly":false}]}} |