[Solved] Anim8, help regarding "getFrameInfo()" requested
Posted: Wed Jun 06, 2018 2:48 pm
Hi!
Above image is a gif. I couldn't get it to animate. Please click to see my example illustrated
I have just added a whole lot of hats to my project by just drawing them on top of my sprites, but instead of animating each and every one of them to fit the player animation I want to move them accordingly by checking what frame the current animation is on. For example; if playerRunning_Animation is on frame 1 and 6 I want to move the hat up by 1 pixel and then down again.
Is this possible using Anim8?
I am trying to figure out how to use "getFrameInfo()" to determine this, but I can't seem to figure it out how I am supposed to use it. The documentation reads as follows:
Above image is a gif. I couldn't get it to animate. Please click to see my example illustrated
I have just added a whole lot of hats to my project by just drawing them on top of my sprites, but instead of animating each and every one of them to fit the player animation I want to move them accordingly by checking what frame the current animation is on. For example; if playerRunning_Animation is on frame 1 and 6 I want to move the hat up by 1 pixel and then down again.
Is this possible using Anim8?
I am trying to figure out how to use "getFrameInfo()" to determine this, but I can't seem to figure it out how I am supposed to use it. The documentation reads as follows:
How do I check which frame the animation is currently on? Please help a newbie out!`animation:getFrameInfo(x,y, r, sx, sy, ox, oy, kx, ky)`
This functions returns the parameters that would be passed to `love.graphics.draw` when drawing this animation:
`frame, x, y, r, sx, sy, ox, oy, kx, ky`.
* `frame` is the currently active frame for the animation (usually a quad produced by a grid)