UI.Texture
Index
Constructors
constructor
Properties
animation
bitmap
delay
isAnimation
Methods
draw
Parameters
canvas: Canvas
x: number
y: number
scale: number
Returns void
drawCutout
fitAllToOneSize
Resizes all the frames to match the first one.
Returns void
getBitmap
Parameters
frame: number
frame number
Returns Bitmap
Bitmap object containing animation frame for the corresponding frame number.
getBitmapWrap
Parameters
frame: number
Returns IBitmapWrap
getFrame
Returns number
Frame number of the animation corresponding to current system time.
getHeight
Returns number
Height of the texture in pixels.
getWidth
Returns number
Width of the texture in pixels.
isAnimated
Returns boolean
readOffset
Sets texture offsets in pixels from the upper left bound of the bitmap.
Parameters
obj: { x?: number; y?: number }
optionalx: number
optionaly: number
Returns void
release
Releases all allocated resources, should be called when the texture is not longer needed.
Returns void
rescaleAll
Resizes all the frames by constant scale multiplier.
Parameters
scale: number
scale to modify the frames by
Returns void
resizeAll
Resizes all the frames of the texture to the specified size.
Parameters
width: number
height: number
Returns void
Class representing static or animated texture.