This site requires JavaScript, please enable it in your browser!
Greenfoot back
schnatter
schnatter wrote ...

2011/6/8

Get the degree of a rotated GreenfootImage

schnatter schnatter

2011/6/8

#
Hi, via the rotate method I can rotate an GreenfootImage. Is it possible to ask how much a GreenfootImage is rotated, e.g. getRotation? In the API I don't found such a method. regards
Lildarkone Lildarkone

2011/6/8

#
if you are trying to turn an object - eg. getRotation(setRotation()+5); If you would like to ask for the rotation - eg. if(getRotation() == 90)
davmac davmac

2011/6/9

#
@Lildarkone: I think schnatter is talking about the rotation of a GreenfootImage, not of an actor. @schnatter: you can't "get the rotation" of an image because an image doesn't have a rotation. If you rotate an image, the effect is to actually modify the image pixel-by-pixel. If you want to know how much you've rotated an image by, you'll need to track it separately.
You need to login to post a reply.