YoYo Games Wiki

image_angle

From YoYoGames Wiki

Description

(real): the angle at which the object's sprite is rotated around the origin point

Explanation

The image_angle local variable is the variable that defines the angle at which the object's sprite will be rotated around the origin point of the same corresponding sprite.

For the result to appear, no actions must be in the drawing event, or the draw_sprite_ext is used with sprite_index, image_index, image_angle, and other GM variables corresponding to the object's sprite's state.

Unlike just drawing rotated sprite, the changing of this variable will also rotate the bounding box of the object, and therefore keep collision checking work properly.

Remarks

This requires the pro version of Game Maker. It was introduced in Game Maker 6.0 and exists onwards.