Nimbus, Animation Lib

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
nikneym
Citizen
Posts: 56
Joined: Sat Mar 09, 2013 1:22 pm
Contact:

Nimbus, Animation Lib

Post by nikneym »

I was always had to write a new animation framework every project. So i thought maybe i should make only one thing and use it on the couple of projects. Sooo i made Nimbus.

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
Download it below!
nimbus.love
(44.18 KiB) Downloaded 134 times
Last edited by nikneym on Wed Nov 15, 2017 7:43 pm, edited 2 times in total.
KayleMaster
Party member
Posts: 234
Joined: Mon Aug 29, 2016 8:51 am

Re: Nimbus, Animation framework

Post by KayleMaster »

You might wanna consider supporting quads, I have all my animations in one texture atlas.
That's why I use anim8, it just needs an array of quads so my sprites don't even have to be next to each other ;)
User avatar
nikneym
Citizen
Posts: 56
Joined: Sat Mar 09, 2013 1:22 pm
Contact:

Re: Nimbus, Animation framework

Post by nikneym »

It supports quads too! try nimbus.newSheet() function.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: Nimbus, Animation framework

Post by grump »

Thanks for sharing. I had a quick look at it, and I have some critique for you.
  • Calling it an "animation framework" is pretty misleading. It takes a bunch of image files and displays them one after the other. "Animation framework" is a pretty big name for that.
  • Can only use frames of a fixed size of 200x200 pixels(?)
  • It's a library, not a framework. A framework is defined by inversion of control: you call a library,
    a framework calls you.
Not trying to be mean, sorry.
User avatar
nikneym
Citizen
Posts: 56
Joined: Sat Mar 09, 2013 1:22 pm
Contact:

Re: Nimbus, Animation framework

Post by nikneym »

You're right. I'm learning english by the help of this forum actually. And i didn't know how to call it at first (framework, lib, etc.) Also there is a bug in the newSheet function i was trying it and i forget to change it back. Gonna fix it! Thank you for your comment.
Post Reply

Who is online

Users browsing this forum: No registered users and 52 guests