I want to mirror an image...
I know Scale -1.... but I',m rotating it arround different center, so i need to set the new rotation center for the mirrored image and the rotation point... but it's very hard to do since the negative scaling doesn't seem to work as i expected...
Mirroring Image
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Mirroring Image
It doesn't work as expected, or that's what I expect (:P). Anyway, rude knows the problem, so let's wait for 0.6.0.
Re: Mirroring Image
When is 0.6.0 released? I mean if that's in several month that would be waiting month before I can go on in gfx design....
Re: Mirroring Image
Months. Many many months.Sparx wrote:When is 0.6.0 released? I mean if that's in several month that would be waiting month before I can go on in gfx design....
Now posting IN STEREO (where available)
- Sardtok
- Party member
- Posts: 108
- Joined: Thu Feb 21, 2008 2:37 pm
- Location: Norway/Norge/諾威/挪威 (Yes, I'm teh back!)
- Contact:
Re: Mirroring Image
There's of course always the simple solution of making flipped graphics in the actual image files.
Not a good solution, but it gets the job done.
Not a good solution, but it gets the job done.
Take off every Zigg for great rapist.
Now, outgay that!
Now, outgay that!
Re: Mirroring Image
I found an algorithm mirroring images with different center. Very strange functions i needed.. adjusted it by foot. I have a 1px error and it works with all 3 images I am using....
If this is the code of displaying the image "normall"
Here the corresponding code for the mirrorred image
MYIMAGEToOverallCenter is the relative position to the players center. This makes absolutely no sense to me to integrate this in the set center function but NOTE: this is working for my Charakter in the game with all images i tested with +-1p... so close enough to use it...
If someone finds out the exact sollution PLEASE tell me!!!
If this is the code of displaying the image "normall"
Code: Select all
MYIMAGE:setCenter(MYIMAGEROTATIONCENTERX,MYIMAGEROTATIONCENTERY)
love.graphics.draw(MYIMAGE, xpos-MYIMAGEToOverallCenterX, ypos-MYIMAGEToOverallCenterY, ANGLE, 1, 1)
Code: Select all
MYIMAGE:setCenter(MYIMAGEROTATIONCENTERX+3*MYIMAGEToOverallCenterX+MYIMAGE:getWidth()-5,MYIMAGEROTATIONCENTERY)
love.graphics.draw(MYIMAGE, xpos+MYIMAGEToOverallCenterX-1, ypos-MYIMAGEToOverallCenterY, ANGLE, -1, 1)
If someone finds out the exact sollution PLEASE tell me!!!
Who is online
Users browsing this forum: Ahrefs [Bot] and 3 guests