Gif
Implements
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Parameters
path: string
Path to the image resource
bustCache: boolean = false
Optionally load texture with cache busting
Returns Gif
Properties
publicdata
Data associated with a loadable
publicheight
The height of the texture in pixels
publicpath
Path to the image resource
publicwidth
The width of the texture in pixels
Accessors
publicbustCache
Should excalibur add a cache busting querystring? By default false. Must be set before loading
Returns boolean
Parameters
val: boolean
Returns void
publicreadCheckBytes
Returns number[]
Methods
publicisLoaded
Returns true if the loadable is loaded
Returns boolean
publicload
Begins loading the texture and returns a promise to be resolved on completion
Returns Promise<ImageSource[]>
publictoAnimation
Transform the GIF into an animation with duration per frame
Parameters
optionaldurationPerFrame: number
Optionally override duration per frame
Returns Animation
publictoSprite
Return a frame of the gif as a sprite by id
Parameters
id: number = 0
Returns Sprite
publictoSpriteSheet
Return the gif as a spritesheet
Returns SpriteSheet
The Texture object allows games built in Excalibur to load image resources. Texture is an Loadable which means it can be passed to a Loader to pre-load before starting a level or game.