Compatibility Setting Unusable In Sources

Reporter: RobertBColton  |  Status: open  |  Last Modified: January 07, 2019, 09:06:44 AM

This issue stems from #1447 which was merged without fixing GM5 compatibility for the functions involved. The reason was because it became difficult to include and make use of the compatibility macro from the sprite's source file.

It was discovered in #1099 that the stretched sprite drawing functions ignore the origin in GM8 and GM:S. I revealed in #1447 that GM5 will actually scale the origin instead of ignoring it. Hence, we can add backwards compatibility if we fix the compatibility macro.

GameMaker 5 Stretched Sprite Origin is Scaled

GM5 Stretched Sprite Origin Scaled

Thanks to @fundies getting GameMaker 6 running in WINE, I am able to confirm that GM5 was the last version to scale the origin of the sprite for the stretched drawing functions. Every later version of GM just totally ignores the origin for these functions.
Test GMD download:

Game Maker 6 Stretched Sprite Ignore Origin

GM6 Stretched Sprite Ignore Origin

Game Maker 5 Stretched Sprite Scale Origin

GM5 Stretched Sprite Scale Origin


Just to mention, I went back now and tested the stretched sprite origin in GameMaker 4 and it does appear to behave like GM5. Any changes to the sprite's origin property causes it to draw differently when draw_sprite_stretched is called. This means a fixed compatibility setting would be nice for legacy purposes.

So basically:

  • GM4 - GM5: sprite origin is scaled
  • GM6 - GMS: sprite origin is ignored

draw_sprite_stretched(n,img,x,y,w,h) Draws the sprite stretched such
that it fills the region with top- left corner (x,y) and width w and height h..

Download GM4 GMD Test Project:

GM4 Stretched Sprite Origin Test
GM4 Stretched Sprite Origin Project

Please sign in to post comments, or you can view this issue on GitHub.