This commit is contained in:
the me 2022-08-07 14:14:04 -07:00
commit 09ade10207
117 changed files with 2153 additions and 0 deletions

View file

@ -0,0 +1,20 @@
function draw_sprite_at(sprite_index, image_index, x, y, maxwidth, maxheight) {
var ratio1 = maxwidth/sprite_get_width(sprite_index);
var ratio2 = maxheight/sprite_get_height(sprite_index);
if ratio2 > ratio1 {
var ratio = ratio2;
} else {
var ratio = ratio1;
}
draw_sprite_stretched(sprite_index, image_index, x-sprite_get_xoffset(sprite_index)*ratio, y-sprite_get_yoffset(sprite_index)*ratio, sprite_get_width(sprite_index)*ratio, sprite_get_height(sprite_index)*ratio);
}
function draw_sprite_at_ext(sprite_index, image_index, x, y, maxwidth, maxheight, color, alpha) {
var ratio1 = maxwidth/sprite_get_width(sprite_index);
var ratio2 = maxheight/sprite_get_height(sprite_index);
if ratio2 > ratio1 {
var ratio = ratio2;
} else {
var ratio = ratio1;
}
draw_sprite_stretched_ext(sprite_index, image_index, x-sprite_get_xoffset(sprite_index)*ratio, y-sprite_get_yoffset(sprite_index)*ratio, sprite_get_width(sprite_index)*ratio, sprite_get_height(sprite_index)*ratio, color, alpha);
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "drawing",
"path": "folders/Scripts/drawing.yy",
},
"resourceVersion": "1.0",
"name": "draw_sprite_at",
"tags": [],
"resourceType": "GMScript",
}