TiledAnimation
Hierarchy
- Animation- TiledAnimation
 
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
- Parameters- options: GraphicOptions & Omit<AnimationOptions, frames> & TiledAnimationOptions
 - Returns TiledAnimation
Properties
publicdata
publicevents
publicframeDuration
publicframes
readonlyid
publicopacity
Gets or sets the opacity of the graphic, 0 is transparent, 1 is solid (opaque).
publicready
publicshowDebug
Gets or sets wether to show debug information about the graphic
publicstrategy
publicoptionaltint
publictransform
Accessors
publiccanFinish
- Returns - trueif the animation can end- Returns boolean
publiccurrentFrame
- Returns the current Frame of the animation - Use Animation.currentFrameIndex to get the frame number and Animation.goToFrame to set the current frame index - Returns Frame
publiccurrentFrameIndex
- Returns the current frame index of the animation - Use Animation.currentFrame to grab the current Frame object - Returns number
publiccurrentFrameTimeLeft
- Returns the amount of time in milliseconds left in the current frame - Returns number
publicdirection
- Returns the current play direction of the animation - Returns AnimationDirection
publicdone
- Returns - trueif the animation is done, for looping type animations- ex.AnimationStrategy.PingPongand- ex.AnimationStrategy.Loopthis will always return- false- See the - ex.Animation.canFinish()method to know if an animation type can end- Returns boolean
publicflipHorizontal
- Gets or sets the flipHorizontal, which will flip the graphic horizontally (across the y axis) - Returns boolean
- Parameters- value: boolean
 - Returns void
publicflipVertical
- Gets or sets the flipVertical, which will flip the graphic vertically (across the x axis) - Returns boolean
- Parameters- value: boolean
 - Returns void
height
- Gets or sets the height of the graphic (always positive) - Returns number
- Parameters- height: number
 - Returns void
publicisPlaying
- Returns - trueif the animation is playing- Returns boolean
publicisReversed
- Returns boolean
publiclocalBounds
- Gets a copy of the bounds in pixels occupied by the graphic on the the screen. This includes scale. - Returns BoundingBox
publicorigin
publicrotation
- Gets or sets the rotation of the graphic - Returns number
- Parameters- value: number
 - Returns void
publicscale
sourceView
- Returns Partial<SourceView>
- Parameters- sourceView: Partial<SourceView>
 - Returns void
publicspeed
- Current animation speed - 1 meaning normal 1x speed. 2 meaning 2x speed and so on. - Returns number
- Current animation speed - 1 meaning normal 1x speed. 2 meaning 2x speed and so on. - Parameters- val: number
 - Returns void
width
- Gets or sets the width of the graphic (always positive) - Returns number
- Parameters- width: number
 - Returns void
Methods
publicclone
- Returns a new instance of the graphic that has the same properties - Type parameters- T: typeof Animation
 - Returns InstanceType<T>
publiccloneGraphicOptions
- Returns GraphicOptions
publicdraw
- Draw the whole graphic to the context including transform - Parameters- ex: ExcaliburGraphicsContext- The excalibur graphics context 
- x: number
- y: number
 - Returns void
publicgoToFrame
- Jump the animation immediately to a specific frame if it exists - Optionally specify an override for the duration of the frame, useful for keeping multiple animations in sync with one another. - Parameters- frameNumber: number
- optionalduration: number
 - Returns void
publicisStale
- Returns boolean
publicpause
- Pauses the animation on the current frame - Returns void
publicplay
- Plays or resumes the animation from the current frame - Returns void
publicreset
- Reset the animation back to the beginning, including if the animation were done - Returns void
publicreverse
- Reverses the play direction of the Animation, this preserves the current frame - Returns void
publictick
- Called internally by Excalibur to update the state of the animation potential update the current frame - Parameters- elapsed: number- Milliseconds elapsed 
- idempotencyToken: number = 0- Prevents double ticking in a frame by passing a unique token to the frame 
 - Returns void
publicstaticfromAnimation
- Parameters- animation: Animation
- optionaloptions: Omit<TiledAnimationOptions, animation>
 - Returns TiledAnimation
publicstaticfromSpriteSheet
- Create an Animation from a SpriteSheet, a list of indices into the sprite sheet, a duration per frame and optional AnimationStrategy - Example: - const spriteSheet = SpriteSheet.fromImageSource({...}); const anim = Animation.fromSpriteSheet(spriteSheet, range(0, 5), 200, AnimationStrategy.Loop);- Type parameters- T: typeof Animation
 - Parameters- this: T
- spriteSheet: SpriteSheet- ex.SpriteSheet 
- spriteSheetIndex: number[]- 0 based index from left to right, top down (row major order) of the ex.SpriteSheet 
- durationPerFrame: number- duration per frame in milliseconds 
- strategy: AnimationStrategy = AnimationStrategy.Loop- Optional strategy, default AnimationStrategy.Loop 
- optionaldata: Record<string, any>
 - Returns InstanceType<T>
publicstaticfromSpriteSheetCoordinates
- Create an Animation from a SpriteSheet given a list of coordinates - Example: - const spriteSheet = SpriteSheet.fromImageSource({...}); const anim = Animation.fromSpriteSheetCoordinates({ spriteSheet, frameCoordinates: [ {x: 0, y: 5, duration: 100, options { flipHorizontal: true }}, {x: 1, y: 5, duration: 200}, {x: 2, y: 5}, {x: 3, y: 5} ], strategy: AnimationStrategy.PingPong });- Type parameters- T: typeof Animation
 - Parameters- this: T
- options: FromSpriteSheetOptions
 - Returns InstanceType<T>- Animation 
Create an Animation given a list of
framesin AnimationOptionsTo create an Animation from a SpriteSheet, use Animation.fromSpriteSheet