Hello everybody,
I am trying to rotate an image filled within a polygon.
Here is my code :
-- create a 400 x 100 polygon and fill it with an image of same size local polygon = display.newPolygon (200, 50, {0, 0, 400, 0, 400, 100, 0, 100}) polygon.fill = {type="image", filename="image\_400\_100.png"} local rotatePolygonImage = function () polygon.fill.rotation = polygon.fill.rotation + 1 end timer.performWithDelay (500, rotatePolygonImage, 360)
But the when the rotation is applied, the whole image is scaled to fit in the polygon.
Is there a way to make the rotation within the polygon without scaling the image? That is if part of the image is outside the polygon boundary, then it will not be visible.
I am playing with the scaleX and scaleY properties but with no success.
Can someone help?