how do i get the current Frame in anim8

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
H.I
Prole
Posts: 8
Joined: Wed Mar 29, 2023 3:34 pm

how do i get the current Frame in anim8

Post 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 :death:
MrFariator
Party member
Posts: 563
Joined: Wed Oct 05, 2016 11:53 am

Re: how do i get the current Frame in anim8

Post 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 )
User avatar
H.I
Prole
Posts: 8
Joined: Wed Mar 29, 2023 3:34 pm

Re: how do i get the current Frame in anim8

Post by H.I »

thanks!,it worked :awesome:
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests