Hello,
I’m almost sure what I’m doing is correct on paper but I just can’t get it to work on corona. I have a rectangle:
temprect = display.newRect(500, 500, 100, 10)
What I want to do is to find out the X and Y values where rectangle ends. In this case it is X: 550, Y: 500
But I want to be able to find them even after rotation so I’m using:
tempX = temprect.x + ((temprect.width) \* math.cos(temprect.rotation)) tempY = temprect.y + ((temprect.width) \* math.sin(temprect.rotation))
But it doesn’t give me the correct X, Y. I also tried using:
local bounds = temprect.contentBounds tempX = bounds.xMax tempY = bounds.yMax
But still no chance. The code works for angles 0, 90, 180 but nothing else. I must be missing something obvious and simple. Any help?