Skip to content

Deb84/SpriteSheetPlayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SpriteSheetPlayer for Roblox

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.

How to use

You can simply require the lib like this

local SpriteSheetPlayer = require(Location.SpriteSheetPlayer.SpriteSheetPlayer)

Variables required:

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)

Fonctions

Create a new animation

.new()

local animation = SpriteSheetPlayer.new(name, ImageLabel, imageSize, gridSize, framerate)

Play an animation

Play a sprite sheet animation synchronously:

:play()

animation:play()

Warning

For now, synchronous can't be stopped, the sprite sheet can be played forever

Async:

Play a sprite sheet animation asynchronously:

:playAsync()

animation:playAsync()

Stop the animation

:stop()

animation:stop()

Edit the value while an animation is playing

:edit()

animation:edit({setting = value})
animation:edit({framerate = 15})

Delete an animation

:delete()

animation:delete()
animation = nil

About

A simple mini-lib for Roblox which allows to play sprite sheet on an imageLabel.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages