Page 2 of 2

Re: Best way to animate?

Posted: Tue Aug 14, 2012 2:38 am
by Devon Peak
kikito wrote:Like Zeliarden is saying, the problem is that "10-10,1" literally means "get all the quads that result from iterating over x, starting in 10 and ending in 10, and using y=1". This only gives one frame: x=10,y=1. Your image does't have that frame (it only goes until x=4), hence the error.
I need one frame but I thought when the sprite sheet row ended it goes to the next frame. Should my sprite be 1 row to use "10-10,1"

Re: Best way to animate?

Posted: Tue Aug 14, 2012 12:02 pm
by kikito
Ok, I think I understand now. You mean that your spritesheet is one big animation.

anim8 does not "go to the next line automatically", as you assumed. You have two ways to solve your issue:

1. You edit your spritesheet to be "one big row of 10 quads". Then you can use g("1-10,1") as the animation.

-or-

2. You leave your spritesheet as it is, but use g("1-4,1", "1-4,2", 1,3, 1,4) instead.

Re: Best way to animate?

Posted: Tue Aug 14, 2012 5:48 pm
by Devon Peak
Okay, but can I use 10-10 for a one frame "animation".

Re: Best way to animate?

Posted: Wed Aug 15, 2012 8:23 am
by kikito
Devon Peak wrote:Okay, but can I use 10-10 for a one frame "animation".
Hmm... I'm under the impression that you are still missing something.

anim8's grids accept two kinds of parameters to specify groups of quads: either one string, or two numbers. Two numbers specify just one quad: 10,1, for example, represents the quad in the position x=10, y=1.

Strings allow you to represent more than one quad in a succint way; you can represent more than 1 quad with a single string. All strings must have the form "a,b", where a and b are either a number or an interval. For example, "1-10,1" represents a list of quads where x goes from 1 to 10 and y remains constant. In numbers, it would be equivalent to 1,1, 2,1, 3,1, 4,1, 5,1, 6,1, 7,1, 8,1, 9,1, 10,1 .

When you give "10-10", alone, to anim8, that doesn't mean anything. You must give it either "10-10,1" or "1,10-10". You could use those if you wanted, but since they mean just one quad, it's just simpler to use numbers: 10,1 and 1,10 will do the same, and save you some typing.

Re: Best way to animate?

Posted: Thu Aug 30, 2012 2:40 am
by joshandersen
Is there a size (source image) or frame count limit for anim8?

I created a sort of 'intro' or idle screen for my game. It is large, 17920 * 144 pixels (this is to be split into 112 frames through anim8).

function love.load()

image = love.graphics.newImage("intro.png")
local g = anim8.newGrid(160, 144, image:getWidth(), image:getHeight())
animation = anim8.newAnimation('loop', g('1-112,1'), 0.05)

end

I have in the main.lua file the proper requirements, update & draw functions. The main problem seems to be the size of the thing.
No 'errors' are thrown when I run it, the screen simply remains white.

Any thoughts would be appreciated.

Thanks-

Re: Best way to animate?

Posted: Fri Aug 31, 2012 5:11 pm
by Robin
That's probably your video card. Usually, they just make the thing white if they can't handle it for some reason or another. And that is different for different video cards and drivers. So it should work fine if you split the animation in several images, but I don't know if anim8 likes that.

Re: Best way to animate?

Posted: Sat Sep 01, 2012 1:41 pm
by kikito
Robin wrote:That's probably your video card. Usually, they just make the thing white if they can't handle it for some reason or another. And that is different for different video cards and drivers. So it should work fine if you split the animation in several images, but I don't know if anim8 likes that.
Robin is right. It's almost surely a limitation of your graphics card. To check it, simply try to draw the image you have your frames in (with love.graphics.draw). Chances are that it will still be blank.

Anim8 does allow the possibility of having frames coming from several images (since the image has to be thrown in into Animation:draw) but it is not particularly easy or recommendable.

I think the easiest way to overcome this issue would be using a more "graphics card-friendly" image size - try with a 2056x1024 image instead (first try to draw the image alone, with love.graphics.draw). If that doesn't work, the next easier solution would be using less/smaller frames, so that they hold into a 1024x1024 image, which most graphics cards use. If that doesn't work, then the next option would be splitting the animation into two smaller animations.