SpriteSheetPlayer is a mini-lib for Roblox written in Luau which allows to use spritesheet/flipbook on an imageLabel Instance.
Warning
Still in development! A lot of features are not yet implemented!
This README can also be not updated when you use it so
please feel free to open an issue if you have any problems.
You can simply require the lib like this
local SpriteSheetPlayer = require(Location.SpriteSheetPlayer.SpriteSheetPlayer)imageLabel The imageLabel instance
gridSize The number of rows and columns (exemple: 8, only square are supported for now)
imageSize The total sprite sheet size in pixel, only if you use PlayWithRect (exemple: 1024, needed to calculate the size of the frames)
framerate Frame Per Second (FPS) (exemple: 24)
.new()
local animation = SpriteSheetPlayer.new(name, ImageLabel, imageSize, gridSize, framerate)Play a sprite sheet animation synchronously:
:play()
animation:play()Warning
For now, synchronous can't be stopped, the sprite sheet can be played forever
Play a sprite sheet animation asynchronously:
:playAsync()
animation:playAsync():stop()
animation:stop():edit()
animation:edit({setting = value})
animation:edit({framerate = 15}):delete()
animation:delete()
animation = nil