How do you make an animation in lua? Can you use gifs or what?
Printable View
How do you make an animation in lua? Can you use gifs or what?
Here read this:
http://wiki.ps2dev.org/psp:lua_player:tutorial
file = io.open("test.lua","a")Zitat:
Zitat von Sousanator
pad = Controls.read()
if pad:start() then
file:write(os.time())
end
file.close()
but would that work with a timer,
i though os.time was the clock?
Can anyone get the voice:playing() function working?
ok i think I get it but how do you make it so multiple pictures are used to create an animation?Zitat:
Zitat von Altair
Correct, use multiple png images, then use a timer to display them.Zitat:
Zitat von Greenskull
can someone give an example of how to make a 3 picture smilie animation? I want him to talk.
Well, if you want each frame of the smilie to last for 8 milliseconds, you'd do this:
[HTML]
frame_1 = Image.load("frame_1.png")
frame_2 = Image.load("frame_2.png")
frame_3 = Image.load("frame_3.png")
screen:clear()
while (true) do
--Put image to memory and flip it to screen
screen:blit(0, 0, frame_1)
screen.flip()
--Keep frame showing for 8 milliseconds
screen.WaitVblankStart(8)
--Clear screen to start over
screen:clear()
screen:blit(0, 0, frame_2)
screen.flip()
screen.WaitVblankStart(8)
screen:clear()
screen:blit(0, 0, frame_3)
screen.flip()
screen.WaitVblankStart(8)
screen:clear()
end
[/HTML]
There's probably an error in there somewhere, but that should be a fair idea of how you do it.
hey could someone help me out of this rut, i need a projectile type code so when i shoot i can move around but the bullet keeps on going straight, does anyone know what im talking about if so could u help me out thx :icon_bigg