image_angle (Game Maker)

( Game Maker 6.1, 7 Pro )

image_angle - rotation of a sprite.


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.


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

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution 2.5 License.