Options
All
  • Public
  • Public/Protected
  • All
Menu
classdesc

Creates a DuckEngine Animation

description

The Animation Class. An animation of frames that are used for Sprites

since

2.0.0

Hierarchy

  • Animation

Index

Constructors

constructor

Properties

animationNormalTimer

animationNormalTimer: default
memberof

Animation

description

An internal Timer that is used for counting and playing an AnimationFrame normally

since

2.0.0

animationReverseTimer

animationReverseTimer: default
memberof

Animation

description

An internal Timer that is used for counting and playing an AnimationFrame reversely

since

2.0.0

config

memberof

Animation

description

Configuration for the Animation, changing this has no effect, instead change the values of the Animation.

since

2.0.0

countBy

countBy: number
memberof

Animation

description

What the internal timers count by, defaults to the game delta time so that it can be used in the Scene.update loop

since

2.0.0

currentFrame

currentFrame: AnimationFrame
memberof

Animation

description

The current frame being played

since

2.0.0

currentIndex

currentIndex: number
memberof

Animation

description

The current index of the Animation#frames or Animation#reversedFrames

since

2.0.0

delayTimer

delayTimer: undefined | default
memberof

Animation

description

An internal Timer that is used for counting and delaying before playing the Animation, undefined if Config.delay is not a number

since

2.0.0

frames

frames: AnimationFrame[]
memberof

Animation

description

An array of AnimationFrames generated from Duck.Types.Animation.FrameBase array in config

since

2.0.0

game

game: Game
memberof

Animation

description

Game instance

since

2.0.0

Readonly key

key: string
memberof

Animation

description

A name/key for the Animation, used by AnimationManager to play the animation

since

2.0.0

repeat

repeat: number
memberof

Animation

description

The amount of times the animation repeats, modified from config so that it would work with the internal Timers

since

2.0.0

repeatCounter

repeatCounter: number
memberof

Animation

description

The current amount of times an animation played/repeated

since

2.0.0

reversedFrames

reversedFrames: AnimationFrame[]
memberof

Animation

description

The same as Animation#AnimationFrames but reversed

since

2.0.0

scene

scene: Scene
memberof

Animation

description

Scene instance

since

2.0.0

sprite

sprite: Sprite
memberof

Animation

description

Sprite that the animation is attached to

since

2.0.0

Methods

Protected createFrames

Protected normalStep

pause

  • pause(): void

pauseReverse

  • pauseReverse(): void

play

  • play(): void

playReverse

  • playReverse(): void

restart

  • restart(): void

restartReverse

  • restartReverse(): void

resume

  • resume(): void

resumeReverse

  • resumeReverse(): void

Protected reverseStep

setRepeat

  • setRepeat(repeat: number): void
  • memberof

    Animation

    description

    Sets the repeat amount of the internal normal timer

    since

    2.0.0

    Parameters

    • repeat: number

      Repeat amount

    Returns void

setRepeatReverse

  • setRepeatReverse(repeat: number): void
  • memberof

    Animation

    description

    Sets the repeat amount of the internal reverse timer

    since

    2.0.0

    Parameters

    • repeat: number

      Repeat amount

    Returns void

stop

  • stop(): void

stopReverse

  • stopReverse(): void
  • memberof

    Animation

    description

    Stops/Cancels the Animation using the internal reverse timer

    since

    2.0.0

    Returns void

Generated using TypeDoc