Texture
Index
Constructors
constructor
Methods
getResolution
Returns { h: number; w: number }
Texture resolution after recalculating it with pixel scale.
h: number
w: number
getTexture
Parameters
token: number
Returns string
Current animation frame.
resetAnimation
Resets animation.
Parameters
token: number
Returns Texture
Reference to itself to be used in sequential calls.
setAnimation
Makes texture animated.
Parameters
animation: string[]
array of paths to the animation frames. Each frame should be stored in a separate file
delay: number
specifies each frame delay in ticks
Returns Texture
Reference to itself to be used in sequential calls.
setPixelScale
Sets pixel scale for the texture.
Parameters
scale: number
Returns Texture
setResolution
Specifies texture resolution. If not equal to file dimensions, the image will be stretched to fit the resolution.
Parameters
w: number
h: number
Returns Texture
Reference to itself to be used in sequential calls.
setTexture
Sets texture file path.
Parameters
path: string
Returns Texture
Reference to itself to be used in sequential calls.
Class representing texture that can be animated.
Represents deprecated render type, should be performed in texture packs.