S
Sahibjot Cheema
Guest
I want to draw a gun sprite and have it look towards the mouse. So far the rotation is based around where the drawing is made which is the top left. How can I make it rotate around the center of the drawn image using
draw_sprite_general. I know using draw_sprite_ext fixes this but I would like to use draw_sprite_general.
I decided to record it and post the code and its much simpler. Here is the video.
The gun on the right:
The gun on the left:
The sprites origin point is middle center and its 48 by 48.
EDIT: Closed. Staff said its possible but I shouldn't do it.
draw_sprite_general. I know using draw_sprite_ext fixes this but I would like to use draw_sprite_general.
I decided to record it and post the code and its much simpler. Here is the video.
The gun on the right:
Code:
var dir = point_direction(x, y, mouse_x, mouse_y);
var facing = 1;
if (dir > 90 && dir < 270) facing = -1;
draw_sprite_ext(spr_gun, 0, x, y, 1, facing,dir, image_blend, image_alpha);
Code:
var dir = point_direction(x, y, mouse_x, mouse_y);
var facing = 1;
if (dir > 90 && dir < 270) facing = -1;
draw_sprite_general(spr_gun, 0, 0, 0, 48, 48, x, y, 1, facing, dir, image_blend, image_blend, image_blend, image_blend, image_alpha);
EDIT: Closed. Staff said its possible but I shouldn't do it.
Last edited by a moderator: