Nimbus is an animation framework which supports image to image animations and sprite-sheet animations both. Also its easy to use and change.
Page of Nimbus: http://www.lab.nikneym.com/nimbus/
nimbus.new(file_path, frame_number, animation_speed)
Loads a new image to image sprite to your game. "file_path" means the path you want to use. Also you must add the file name. But you don't have to write the format you're gonna use. Nimbus sets the format automatically to png. You can change it from library's own table. This function needs every image for every frame.
Code: Select all
function love.load()
--Load the lib.
require("nimbus")
--Create a new animation and load files of it.
coolCharacter=nimbus.new("sorcerer_sprite/sorcerer", 10, 130);
end
nimbus.newSheet(file_path, frame_number, animation_speed, width, height)
Loads a new sprite sheet to your game. "file_path" means the path you want to use. Also you must add the file name. But you don't have to write the format you're gonna use. Nimbus sets the format automatically to png. You can change it from library's own table. This function needs 1 image for every frame but you have to add images side by side.
Code: Select all
function love.load()
--Create a new animation and load the file of it.
coolCharacter=nimbus.newSheet("sorcerer", 10, 130, 200, 200)
end
obj:update(dt)
Update event of your animation. Must be used in love.update function. No matter what type your sprite is, it works same.
Code: Select all
function love.update(dt)
--Update event of animation
coolCharacter:update(dt)
end
obj:draw(x, y)
Draws the object to the target x and y location. Must be called on love.draw function.
Code: Select all
function love.draw()
--Draw animation
coolCharacter:draw(240, 70)
end
obj:debug(x, y)
Shows the properties of the animation. Only works with nimbus.new() function for now. Must be called on love.draw function.
Code: Select all
function love.draw()
--Start on debug mode.
coolCharacter:debug(10, 70);
end