[Library] anim8 - An animation library - v2.3.0 released
Posted: Fri Mar 02, 2012 12:38 am
Hi there,
EDIT: I have just released anim8 v2.1.0. The only thing that changes in this version is LÖVE 0.9 compatibility.
Anim8 is always available on github:
https://github.com/kikito/anim8
So - what is this lib?
Its aim is making animations in a single call, in a human-friendly way - minimizing the amount of typing, when possible.
One way of reducing the amount of typing was "splitting" the information in two parts. The first part, I called "Grids", and basically are heavy-duty "Quad creators". Once a grid is created, I initially tought of specifiying the frames of an animation like this:
This is a lot of typing. I decided to leave the brackets out:
That's better, but could be reduced further. For example, it's a very usual case that animations are "rows" or "columns" in the spritesheet. So I decided to allow using strings to define intervals. In anim8, the previous code can also be compressed to the following two params:
Of course, that style can be "mixed up" with numbers. This is equivalent to the previous line:
Another feature I'm proud of is that grids can handle frame borders, or "offset", very easily - once you define those in the grid, it's just "transparent".
Once you have the frames(aka quads) you want, you just pass them on to the "animation". Although very convenient, you don't need to use a grid to provide the animation with the quads; you can create them by other means if you so wish. I recommend using grids whenever possible, because quads are "reused" aggressively; the lib never creates the same quad twice; it "caches" all quads in case it wants to reuse them.
Please give the demo and the README in github a look. Let me know if you have questions or find any bugs!
Attaching demos for LÖVE 0.8 / anim8 2.0 and LÖVE 0.9 / anim8 2.1
Changelog:
v2.3.0
EDIT: I have just released anim8 v2.1.0. The only thing that changes in this version is LÖVE 0.9 compatibility.
Anim8 is always available on github:
https://github.com/kikito/anim8
So - what is this lib?
Its aim is making animations in a single call, in a human-friendly way - minimizing the amount of typing, when possible.
One way of reducing the amount of typing was "splitting" the information in two parts. The first part, I called "Grids", and basically are heavy-duty "Quad creators". Once a grid is created, I initially tought of specifiying the frames of an animation like this:
Code: Select all
grid({1,1}, {1,2}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7})
Code: Select all
grid(1,1, 1,2, 1,3, 1,4, 1,5, 1,6, 1,7)
Code: Select all
grid(1,"1-7")
Code: Select all
grid(1,"1-6", 1,7)
Once you have the frames(aka quads) you want, you just pass them on to the "animation". Although very convenient, you don't need to use a grid to provide the animation with the quads; you can create them by other means if you so wish. I recommend using grids whenever possible, because quads are "reused" aggressively; the lib never creates the same quad twice; it "caches" all quads in case it wants to reuse them.
Please give the demo and the README in github a look. Let me know if you have questions or find any bugs!
Attaching demos for LÖVE 0.8 / anim8 2.0 and LÖVE 0.9 / anim8 2.1
Changelog:
v2.3.0
- Adds support for shearing (kx, ky parameters when drawing)
- Adds Animation:getFrameInfo()
- Adds Animation:getDimensions()
- LÖVE version upped to 0.9.x