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);
}
Have a sarcastic character in your game? Want your text to be more unique? This may be helpful.
/// string_random_case(str);
//
// Convert each letter in a string to either uppercase or lowercase, at random.
//
/// GMLscripts.com/license
function string_random_case(str) {
var origstring = str;
var stringarray = [];
var finalstring = "";
for(var i = 1; i < string_length(origstring); i++) {
stringarray[i] = string_char_at(origstring,i);
stringarray[i] = choose(string_upper(stringarray[i]),string_lower(stringarray[i]));
finalstring += stringarray[i];
}
return finalstring;
}
Pages: 1