Changing the drawn angle of a drawn sprite

From GMpedia.org Wiki

Jump to: navigation, search

[edit] The Question

Instead of making multiple subimages representing different directions of a weapon, I was thinking about using Game Maker 6.x's GM: image_angle variable to change the drawn gun's direction.

How can I do this?

[edit] The Answer

First of all, you must know that the image_angle variable is used to change the object's sprite itself, and not a drawn sprite (unless there is no action in the Draw event). The draw_sprite function only draws a sprite without doing any modification on it, but using draw_sprite_ext will solve your problem:

draw_sprite_ext(SPRITE,-1,x,y,1,1,ANGLE,c_white,1);
Personal tools