This content has been marked as final. Show 3 replies
The sprite rotation does not change the underlying member data, in the same way that changing the size of position doesn't. To perform the same operation with script you need to use Imaging Lingo - specifically using copyPixels.
With copyPixels, you can set a destination quad (four non-rectangular points) to copy image data from one image to another. Your code would look something like
srcImage = member(AnalysedImage).image
destimage = image(new width, newHeight, 32) -- a new image for the rotation, you'll need to calculate a new height & width based on your rotation.
destQuad = calculatedQuad --the rotated corner points for your image -once again, some kind of mathematical rotation that I don't know OTTOMH
destimage.copyPixels(srcImage, destinationQuad, srcImage.rect)
hth as a start
Thank you it put me in the right direction:)
See code below for rotating an image. The resulting image will not have the same precision as the original.
Alternatively, you could simply rotate the sprite (as you are currently doing) then use...
vMemberLoc = sprite(x).mapStageToMember(the mouseLoc)
... to determine which point of the unrotated member appears under the mouse in the rotated sprite.