Class

io.scalajs.dom.html.phaser

AnimationManager

Related Doc: package phaser

Permalink

class AnimationManager extends Object

The Animation Manager is used to add, play and update Phaser Animations. Any Game Object such as Phaser.Sprite that supports animation contains a single AnimationManager instance.

Annotations
@RawJSType() @native() @JSName( "Phaser.AnimationManager" )
See also

https://phaser.io/docs/2.6.2/Phaser.AnimationManager.html

Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AnimationManager
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AnimationManager(sprite: Phaser.Sprite)

    Permalink

    sprite

    A reference to the Game Object that owns this AnimationManager.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def add(name: String, frames: Array[|[JsNumber, String]] = js.native, frameRate: Double = js.native, loop: Boolean = js.native, useNumericIndex: Boolean = js.native): Animation

    Permalink

    Adds a new animation under the given key.

    Adds a new animation under the given key. Optionally set the frames, frame rate and loop. Animations added in this way are played back with the play function.

    name

    The unique (within this Sprite) name for the animation, i.e. "run", "fire", "walk".

    frames

    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.

    frameRate

    The speed at which the animation should play. The speed is given in frames per second.

    loop

    Whether or not the animation is looped or just plays once.

    useNumericIndex

    Are the given frames using numeric indexes (default) or strings?

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. var currentAnim: Phaser.Animation

    Permalink

    The currently displayed animation, if any.

  8. var currentFrame: Phaser.Frame

    Permalink

    The currently displayed Frame of animation, if any.

    The currently displayed Frame of animation, if any. This property is only set once an Animation starts playing. Until that point it remains set as null.

  9. def destroy(): Unit

    Permalink

    Destroys all references this AnimationManager contains.

    Destroys all references this AnimationManager contains. Iterates through the list of animations stored in this manager and calls destroy on each of them.

  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. var frame: Int

    Permalink

    Gets or sets the current frame index and updates the Texture Cache for display.

  14. def frameData: Phaser.FrameData

    Permalink

    The current animations FrameData

  15. var frameName: String

    Permalink

    Gets or sets the current frame name and updates the Texture Cache for display.

  16. def frameTotal: Int

    Permalink

    The total number of frames in the currently loaded FrameData, or -1 if no FrameData is loaded.

  17. var game: Phaser.Game

    Permalink

    A reference to the currently running Game.

  18. def getAnimation(name: String): Phaser.Animation

    Permalink

    Returns an animation that was previously added by name.

    Returns an animation that was previously added by name.

    name

    The name of the animation to be returned, e.g. "fire".

    returns

    The Animation instance, if found, otherwise null.

  19. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  20. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  21. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  22. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  23. var isLoaded: Boolean

    Permalink

    Set to true once animation data has been loaded.

  24. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  25. var name: String

    Permalink

    Gets the current animation name, if set.

  26. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  27. def next(quantity: Int = js.native): Unit

    Permalink

    Advances by the given number of frames in the current animation, taking the loop value into consideration.

    Advances by the given number of frames in the current animation, taking the loop value into consideration.

    quantity

    The number of frames to advance.

  28. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. var paused: Boolean

    Permalink

    Gets and sets the paused state of the current animation.

  31. def play(name: String, frameRate: Double = js.native, loop: Boolean = js.native, killOnComplete: Boolean = js.native): Phaser.Animation

    Permalink

    Play an animation based on the given key.

    Play an animation based on the given key. The animation should previously have been added via animations.add 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.

    name

    The name of the animation to be played, e.g. "fire", "walk", "jump".

    frameRate

    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.

    loop

    Should the animation be looped after playback. If not provided the previously set loop value of the Animation is used.

    killOnComplete

    If set to true when the animation completes (only happens if loop=false) the parent Sprite will be killed.

    returns

    A reference to playing Animation instance.

  32. def previous(quantity: Int = js.native): Unit

    Permalink

    Moves backwards the given number of frames in the current animation, taking the loop value into consideration.

    Moves backwards the given number of frames in the current animation, taking the loop value into consideration.

    quantity

    The number of frames to move back.

  33. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  34. def refreshFrame(): Unit

    Permalink

    Refreshes the current frame data back to the parent Sprite and also resets the texture data.

  35. def stop(name: String = js.native, resetFrame: Boolean = js.native): Unit

    Permalink

    Stop playback of an animation.

    Stop playback of an animation. If a name is given that specific animation is stopped, otherwise the current animation is stopped.

    The currentAnim property of the AnimationManager is automatically set to the animation given.

    name

    The name of the animation to be stopped, e.g. "fire". If none is given the currently running animation is stopped.

    resetFrame

    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)

  36. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  37. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  38. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  39. var updateIfVisible: Boolean

    Permalink

    Should the animation data continue to update even if the Sprite.visible is set to false.

  40. def validateFrames(frames: Array[_], useNumericIndex: Boolean = js.native): Boolean

    Permalink

    frames

    An array of frames to be validated.

    useNumericIndex

    Validate the frames based on their numeric index (true) or string index (false)

    returns

    True if all given Frames are valid, otherwise false.

  41. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  42. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped