Skip to content

AnimationTexture

Basic Properties

FieldDescription
imageLocationThe resource location for the image
cellSizeThe size of each cell in the texture grid
fromThe starting cell index for animation
toThe ending cell index for animation
animationThe animation speed value
colorThe color overlay applied to the texture

APIs

setTexture

Sets the texture

java
animationTexture.setTexture("ldlib:textures/gui/particles.png");

setCellSize

Sets the cell size. Refer to how many cells does the animation texture need to be divided into (side length).

java
animationTexture.setCellSize(8);

setAnimation

Sets the animation range from which cell to which cell.

java
animationTexture.setAnimation(32, 44);

setAnimation

Sets the animation speed. Tick time between cells.

java
animationTexture.setAnimation(1);

setColor

Sets the texture color.

java
animationTexture.setColor(0xff000000);

Released under the MIT License.