Class/Object

io.scalajs.dom.html.phaser

Animation

Related Docs: object Animation | package phaser

Permalink

class Animation extends Object

An Animation instance contains a single animation and the controls to play it.

It is created by the AnimationManager, consists of Animation.Frame objects and belongs to a single Game Object such as a Sprite.

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

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

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

Instance Constructors

  1. new Animation(game: Phaser.Game, parent: Phaser.Sprite, name: String, frameData: Phaser.FrameData, frames: Array[|[JsNumber, String]], frameRate: Double = js.native, loop: Boolean = js.native)

    Permalink

    game

    A reference to the currently running game.

    parent

    A reference to the owner of this Animation.

    name

    The unique name for this animation, used in playback commands.

    frameData

    The FrameData object that contains all frames used by this Animation.

    frames

    An array of numbers or strings indicating which frames to play in which order.

    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.

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. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def complete(): Unit

    Permalink

    Called internally when the animation finishes playback.

    Called internally when the animation finishes playback. Sets the isPlaying and isFinished states and dispatches the onAnimationComplete event if it exists on the parent and local onComplete event.

  7. var currentFrame: Phaser.Frame

    Permalink

    The currently displayed frame of the Animation.

  8. var delay: Double

    Permalink

    The delay in ms between each frame of the Animation, based on the given frameRate.

  9. def destroy(): Unit

    Permalink

    Cleans up this animation ready for deletion.

    Cleans up this animation ready for deletion. Nulls all values and references.

  10. var enableUpdate: Boolean

    Permalink

    Gets or sets if this animation will dispatch the onUpdate events upon changing frame.

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

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

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

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

    Permalink

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

  15. var frameData: Phaser.FrameData

    Permalink

    The FrameData object that contains all frames used by this Animation.

  16. var frameRate: Double

    Permalink

    The speed at which the animation should play.

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

  17. def frameTotal: Int

    Permalink

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

  18. var frames: Array[|[JsNumber, String]]

    Permalink

    An array of numbers or strings indicating which frames to play in which order.

  19. var game: Phaser.Game

    Permalink

    A reference to the currently running game.

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  23. var isFinished: Boolean

    Permalink

    The finished state of the Animation.

    The finished state of the Animation. Set to true once playback completes, false during playback.

  24. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  25. var isPaused: Boolean

    Permalink

    The paused state of the Animation.

  26. var isPlaying: Boolean

    Permalink

    The playing state of the Animation.

    The playing state of the Animation. Set to false once playback completes, true during playback.

  27. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  28. var isReversed: Boolean

    Permalink

    Indicates if the animation will play backwards.

  29. var killOnComplete: Boolean

    Permalink

    Should the parent of this Animation be killed when the animation completes?

  30. var loop: Boolean

    Permalink

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

  31. var loopCount: Int

    Permalink

    The number of times the animation has looped since it was last started.

  32. var name: String

    Permalink

    The unique name for this animation, used in playback commands.

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

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

    Permalink

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

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

    quantity

    The number of frames to advance.

  35. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  37. var onComplete: Phaser.Signal

    Permalink

    This event is dispatched when this Animation completes playback.

    This event is dispatched when this Animation completes playback. If the animation is set to loop this is never fired, listen for onLoop instead.

  38. var onLoop: Phaser.Signal

    Permalink

    This event is dispatched when this Animation starts playback.

  39. def onPause(): Unit

    Permalink

    Called when the Game enters a paused state.

  40. def onResume(): Unit

    Permalink

    Called when the Game resumes from a paused state.

  41. var onUpdate: Phaser.Signal

    Permalink

    This event is dispatched when the Animation changes frame.

    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. Note that the event is only dispatched with the current frame. In a low-FPS environment Animations will automatically frame-skip to try and claw back time, so do not base your code on expecting to receive a perfectly sequential set of frames from this event.

  42. var parent: Phaser.Sprite

    Permalink

    A reference to the owner of this Animation.

  43. var paused: Boolean

    Permalink

    Gets and sets the paused state of this Animation.

  44. def play(frameRate: Double = js.native, loop: Boolean = js.native, killOnComplete: Boolean = js.native): Animation.this.type

    Permalink

    Plays this animation.

    Plays this animation.

    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 this Animation instance.

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

    Permalink

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

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

    quantity

    The number of frames to move back.

  46. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  47. def restart(): Unit

    Permalink

    Sets this animation back to the first frame and restarts the animation.

  48. def reverse(): Animation.this.type

    Permalink

    Reverses the animation direction.

    Reverses the animation direction.

    returns

    A reference to this Animation instance.

  49. def reverseOnce(): Animation.this.type

    Permalink

    Reverses the animation direction for the current/next animation only Once the onComplete event is called this method will be called again and revert the reversed state.

    Reverses the animation direction for the current/next animation only Once the onComplete event is called this method will be called again and revert the reversed state.

    returns

    The animation instance.

  50. var reversed: Boolean

    Permalink

    Gets and sets the isReversed state of this Animation.

  51. def setFrame(frameId: |[JsNumber, String] = js.native, useLocalFrameIndex: Boolean = js.native): Unit

    Permalink

    Sets this animations playback to a given frame with the given ID.

    Sets this animations playback to a given frame with the given ID.

    frameId

    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.

    useLocalFrameIndex

    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.

  52. var speed: Double

    Permalink

    Gets or sets the current speed of the animation in frames per second.

    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. Value must be greater than 0.

  53. def stop(resetFrame: Boolean = js.native, dispatchComplete: Boolean = js.native): Unit

    Permalink

    Stops playback of this animation and set it to a finished state.

    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. If dispatchComplete is true it will dispatch the complete events, otherwise they'll be ignored.

    resetFrame

    If true after the animation stops the currentFrame value will be set to the first frame in this animation.

    dispatchComplete

    Dispatch the Animation.onComplete and parent.onAnimationComplete events?

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  57. def update(): Unit

    Permalink

    Updates this animation.

    Updates this animation. Called automatically by the AnimationManager.

  58. def updateFrameData(frameData: Phaser.FrameData): Unit

    Permalink

    Changes the FrameData object this Animation is using.

    Changes the FrameData object this Animation is using.

    frameData

    The FrameData object that contains all frames used by this Animation.

  59. def valueOf(): Any

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  62. 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