You are not logged in.
Pages: 1
This is much simpler to use than creating a bunch of different variables to use for one function, plus it all takes place in one line.
/// draw_sprite_animated(spr, _x, _y);
//
// Draw an animated sprite at an x and y coordinate, based on its original image speed as set in the sprite editor.
// spr The sprite you want to draw
// _x The x position to draw the sprite
// _y The y position to draw the sprite
//
// Unlike draw_sprite(), there is no space for a sub-image; that is calculated automatically with the script
//
/// GMLscripts.com/license
function draw_sprite_animated(spr,_x,_y) {
var _t = (current_time/1000) * sprite_get_speed(spr);
return draw_sprite(spr,_t,_x,_y);
}
Last edited by helloitscrash (2023-03-07 18:20:35)
Offline
Shouldn't it also take "sprite_get_speed_type" into account?
Offline
Pages: 1