image_angle (Game Maker)
( Game Maker 6.1, 7 Pro )
image_angle - rotation of a sprite.
Description
image_angle is a local variable that contains the rotation of a sprite in degrees. The value of image_anglecorresponds to direction in that 0 to 359 are the same angle. However, unlike direction, the value of image_angle does not return to 0 after reaching 359.
Examples
Example of Use
image_angle = 90;
If the sprite was originally drawn facing right, it will now be facing up.
Facing Another Object
image_angle = point_direction(x,y,obj_player.x,obj_player.y);
If this code is placed in the Step event the instance will always face obj_player.
Useful Info
- If you want to use 360 control with image_angle, make sure to create the sprite so that it faces right. This way it will line up with the degrees.
Related Pages
page revision: 14, last edited: 30 Jun 2012 15:48