Page 1 of 1

Animation Create Question

Posted: Sat Nov 14, 2009 8:46 am
by poorenglish
I can't create Animation by the attachment PNG files.
The code like the "Example 11: Create and use an Animation "
---------------------------------------------------------------------------------------------------------
function load()
-- Set a lovely pink background color.
love.graphics.setBackgroundColor(246, 198, 222)

-- Load the source of the animation.
local img = love.graphics.newImage("images/a.png")
--local img = love.graphics.newImage("images/anim-boogie.png")
-- Create an animation with a frame size of 32x32 and
-- 0.1s delay betwen each frame.
anim = love.graphics.newAnimation(img, 320, 240, 0.1)
-- anim = love.graphics.newAnimation(img, 32, 32, 0.1)
end

function update(dt)
-- The animation must be updated so it
-- knows when to change frames.
anim:update(dt)
end

function draw()
-- Draw the animation the center of the screen.
love.graphics.draw(anim, 400, 400)
end
-----------------------------------------------------------------------------------
when I change the picture for default,the program will run normal.
The attachment PNG is 4800*720,one frame is 320*240,is there more key that I ignroe?
Love version is 0.50,OS version is XP SP3
Much thanks

Re: Animation Create Question

Posted: Sun Nov 22, 2009 12:54 am
by Jasoco
Just so you know, last I checked the Animation feature was being removed from 0.6.0 so you might as well not use it. (yet)

Re: Animation Create Question

Posted: Sun Nov 22, 2009 1:32 am
by Robin
Jasoco wrote:Just so you know, last I checked the Animation feature was being removed from 0.6.0 so you might as well not use it. (yet)
Apart from that it is now a pure-Lua library, AnAL.

Re: Animation Create Question

Posted: Sun Nov 22, 2009 1:57 am
by napco
Your image is too big. LOVE can't read huge images. I've already tryed it with a BIG tileset and the result were white (?) tiles.