S
SmugMonster
Guest
Hey folks, so I can't get draw_sprite_general to draw an animated sprite. Here's what I've tried:
I also tried setting image_index to 0 and image_speed to 1 before that, and it didn't work. I also tried -1 instead of image_index, with the same results. The object that's running this code has a sprite with the same number of frames running at the same frame speed as the sprite I'm drawing. It's just drawing subimage 0 instead of animating.
I tried a manual workaround, but the last frame is hanging around a moment before disappearing, so that's not gonna work for me either.
Here's the code for that:
Code:
draw_sprite_general(beam_sprite,image_index,0,0,width,height,x+shift_x,y+shift_y,1,1,image_angle,c_white,c_white,c_white,c_white,1);
I tried a manual workaround, but the last frame is hanging around a moment before disappearing, so that's not gonna work for me either.
Here's the code for that:
Code:
<Create>
frames = sprite_get_number(beam_sprite);
draw_frame_max = frames-1;
<End Step>
if (draw_frame < draw_frame_max)
{
draw_frame++;
}
<Draw Event>
repeat(frames)
{
draw_sprite_general(beam_sprite,draw_frame,0,0,width,height,x+shift_x,y+shift_y,1,1,image_angle,c_white,c_white,c_white,c_white,1);
}