Code: Select all
your_quad = love.graphics.newQuad(x, y, w, h, your_image:getWidth(), your_image:getHeight)
Code: Select all
love.graphics.drawq(your_image, your_quad, x, y, ...)
Just an example. Quite simple.
Code: Select all
your_quad = love.graphics.newQuad(x, y, w, h, your_image:getWidth(), your_image:getHeight)
Code: Select all
love.graphics.drawq(your_image, your_quad, x, y, ...)
Code: Select all
quad_array = {}
for i = 1, number_of_frames do
quad_array[i] = love.graphics.newQuad((i - 1) * frame_width, y, frame_width, frame_height, image:getWidth(), image:getHeight())
end
Code: Select all
current_frame = current_frame + dt * frame_animation_speed
if current_frame > number_frames then current_frame = 1 end
Code: Select all
love.graphics.drawq(image, quad_array[math.floor(current_frame)], x, y, ...)
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 5 guests