Page 1 of 1
how do i get the current Frame in anim8
Posted: Sun Apr 23, 2023 9:12 am
by H.I
so i am trying to get the current frame that is being drawn, but i don't know how to do that, i tried alot of things but nothing really works, getFrameInfo is just giving me error after error,plz help
Re: how do i get the current Frame in anim8
Posted: Sun Apr 23, 2023 9:50 am
by MrFariator
Code: Select all
local frame = animation:getFrameInfo() -- returns the frame quad, not the frame number
-- or
local frame = animation.position -- returns the frame number
This assumes that "animation" is an object returned by anim8.newAnimation.
If you wish to draw the quad after calling getFrameInfo, you could do the following
Code: Select all
love.graphics.draw(your_animation_texture, frame, x_position, y_position )
Re: how do i get the current Frame in anim8
Posted: Sun Apr 23, 2023 10:09 am
by H.I
thanks!,it worked