Hi,
I am working on a tile-based map, but when i try to rotate a square image (90, 180 and 270 degrees), it is rotated by the top-left corner, how can i use his center to rotate it?
* I'm sorry about my english.
Rotate image
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Rotate image
Use the offset x and y parameters of love.draw and offset it by half of the width and height of the image. So if your image was 32 x 64 you would do
See here for more.
Edit:
By the way, you should not use the ['s. Those are there to describe what each number does.
Code: Select all
love.graphics.draw( image, x, y, rotation, 1 [scale x], 1 [scale y], 16 [offset x], 32 [offset y] )
Edit:
By the way, you should not use the ['s. Those are there to describe what each number does.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Who is online
Users browsing this forum: Ahrefs [Bot] and 2 guests