Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7973609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:09:16+00:00 2026-06-04T08:09:16+00:00

I would like to rotate an image in Love2D. I have found a documentation

  • 0

I would like to rotate an image in Love2D.
I have found a documentation on love2d.org: https://love2d.org/wiki/love.graphics.rotate
But I can’t seem to get it to work when I try to load an image.
Heres my code:

local angle = 0

function love.load()
    g1 = love.graphics.newImage("1.png") 
end

function love.draw()
    width = 100
    height = 100
    love.graphics.translate(width/2, height/2)
    love.graphics.rotate(angle)
    love.graphics.translate(-width/2, -height/2)
    love.graphics.draw(g1, width, height)
end

function love.update(dt)
    love.timer.sleep(10)
    angle = angle + dt * math.pi/2
    angle = angle % (2*math.pi)
end

Could anyone show me an simple example of rotating an image in love2d?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:09:17+00:00Added an answer on June 4, 2026 at 8:09 am

    https://love2d.org/wiki/love.graphics.draw

    You may be better off using the fourth argument, shown as ‘r’ to rotate images, such as:

    love.graphics.draw(image, x, y, math.pi/4)
    

    It’s not worth the trouble of using the translate functions for a single draw, and keeping those for when you’re batching many draws at once.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have any image which I would like to rotate and move from right
I need a java method to rotate an image like this , I would
UIImageWriteToSavedPhotosAlbum() works pretty fine until I rotate image. According to condition, I would like
I would like to rotate an image in 360 degrees, like this site .
I would like to have multiple images rotate, or gyrate, or spin, whatever the
I would like to move and rotate an image of a ball in a
I would like to know if I can make an image opaque if set
I have four images. I would like them to rotate in a loop. Under
I would like to spin/rotate my Logo(Image) on the Z axis. This is the
I have an app that I would like to have video capture for the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.