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"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.
Best way to animate?
-
- Prole
- Posts: 7
- Joined: Sat May 19, 2012 5:42 pm
- Location: Streetsboro, OH
- Contact:
Re: Best way to animate?
Aspiring fine artist, graphic designer, and game developer.
website: http://www.devonpeak.wordpress.com
twitter: http://www.twitter.com/_devonpeak
website: http://www.devonpeak.wordpress.com
twitter: http://www.twitter.com/_devonpeak
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Best way to animate?
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.
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.
When I write def I mean function.
-
- Prole
- Posts: 7
- Joined: Sat May 19, 2012 5:42 pm
- Location: Streetsboro, OH
- Contact:
Re: Best way to animate?
Okay, but can I use 10-10 for a one frame "animation".
Aspiring fine artist, graphic designer, and game developer.
website: http://www.devonpeak.wordpress.com
twitter: http://www.twitter.com/_devonpeak
website: http://www.devonpeak.wordpress.com
twitter: http://www.twitter.com/_devonpeak
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Best way to animate?
Hmm... I'm under the impression that you are still missing something.Devon Peak wrote:Okay, but can I use 10-10 for a one frame "animation".
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.
When I write def I mean function.
-
- Prole
- Posts: 3
- Joined: Thu Aug 30, 2012 2:25 am
Re: Best way to animate?
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-
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-
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Best way to animate?
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.
Help us help you: attach a .love.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Best way to animate?
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.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.
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.
When I write def I mean function.
Who is online
Users browsing this forum: Ahrefs [Bot], slime and 4 guests