Draw Sprite Stretched - The drawing should not be centered

Reporter: fervi  |  Status: open  |  Last Modified: January 23, 2018, 11:54:47 AM


By moving my game to EGM I noticed such a mistake.

Using the draw_sprite_stretched function during game play, the drawn graphics have Origin set to "center", the beginning of the graphics is in the center point, and in Game Maker is in the upper left



draw_sprite_stretched(global.graphics, 0, window_get_width()*0.02,window_get_height()*0.02, window_get_width()*0.21,sprite_get_height(spr_cover)*spr_big_prop);
Does anyone know if this is the case in GM6/7/8?

Ok, I think I see what he's saying. So I used Paint.NET to scale this image to 512x512 and then added it as a sprite with a centered 256x256 origin in LGM:

Then I made an object with this draw code:


I couldn't see anything except the text, so I changed the last two parameters to 512 and then I saw the rocky bottom-right of the texture.

I gave it a test in GM5 and no matter whether the last two paramters were 512 or 256, I could always see the bottom-right rocky part of the texture. Thus this is a bug in ENIGMA and the sprite origin needs to be scaled.
GM5 Sprite Origin Scaling
GM5 Game Sprite Origin Scaling

Notice: Undefined variable: context in /var/www/html/enigma-dev.org/issues/view_ticket.php on line 114
Please sign in to post comments, or you can view this issue on GitHub.