//* ANIMATION LIB 3 *\\


This is the third release of Animation Lib. Thanks to Alatnet, i have rewritten the ENTIRE code so that it uses OOP, using metatables.
This code was about 5 times harder to write, but its just about 10,000,000 times easier to use. best of all, IT CREATES EVERYTHING FOR YOU!
Here are all the new functions:


// FUNCTION LIST //

function ANIM.new(frames, header, extension, where)	-- loads a new animation

function ANIM:blit(x, y, delay)	-- blits an animation

function ANIM:pause()	-- pauses the animation

function ANIM:resume()	-- resumes the animation

function ANIM:reset(num)	-- resets the animation (brings it back to the frame you want, which is what "num" means)


function ANIM:advancedBlit(x, y, delay, numloops)	-- same as ANIM:blit() but adds a loop functionality

function ANIM:getTime()	-- returns the current timer time

function ANIM:getFrame()	-- returns the current frame of the animation

function ANIM:getLoops()	-- returns how many loops the animation has made.


// END FUNCTION LIST //


Here is a MUCH SMALLER tutorial on how to use Animation Lib:


// TUTORIAL //

-------------------------------------------------------------------------------------
function ANIM.new(frames, header, extension, where)
-------------------------------------------------------------------------------------

this function loads a new animation. here are what the arguments mean:

frames - the number of frames in your animation.
header - the header of your file, which will be explained later.
extension - the extension of your image.
where - this is used if your images are in a seperate directory. if your pictures are in the same folder as your script, then just leave this blank.


here is some code that will load an animation:

-------------------------------------------------------------------------------------
test = ANIM.new(14, "test", "png", "DATA/animLib/")
-------------------------------------------------------------------------------------

that code will load 14 images:

test1.png
test2.png
test3.png
... all the way to test14.png

in a folder called DATA, and inside that, another folder called animLib. (The example that came with this uses that exact command.)


-------------------------------------------------------------------------------------
function ANIM:blit(x, y, delay)
-------------------------------------------------------------------------------------

this will blit an animation. NOW, when using OOP, you treat it as an object, SO, since you called: test = ANIM.new(14, "test", "png", "DATA/animLib/"),
NOW to blit the animation, you have to call:

------------------------------
test:blit(x, y, delay)
------------------------------

cool huh?

now, lets go to the arguments:

x - x position of the animation.
y - y position of the animation.
delay - the delay you want inbetween frames, (in millisceonds)



the rest of the functions are self-explanatory. but i will explain one more:

-------------------------------------------------------------------------------------
function ANIM:advancedBlit(x, y, delay, numloops)
-------------------------------------------------------------------------------------

this is the EXACT SAME THING as the previous blit function, BUT, this one lets you loop it a certain amount of times.
with the OTHER blit function, it would continue endlessely, with this one, you can set how many loops you want it to do.

numloops - the number of loops you want it to do

after those number of loops, it will stop showing the animation.





//END TUTORIAL//



well, thats it. if you have any questions, look in the sample file, "index.lua". chances are, itll answer your question. if it doesnt, you can PM me at the 
QJ forums. my name there is:

Grimfate126


you can also PM me if you want to tell me suggestions.

please give credit to Grimfate126 if you use it.


have fun!!!!

P.S. the "index.lua" file, when executed, will show an animation that says "ANIMATION LIB 3". youll see what i mean.





