Closed batblaster closed 3 weeks ago
It seems that using image_xscale = -1 the sprite_width instead of return 64 it return -64
You're using sprite_width/2 to set the x position of where the sprite is drawn, this factors in image_xscale, so when you set image_xscale sprite_width/2 is -32 and so the sprite is rendered off the surface.
Sorry something is weird. After so many release now i see that the image_xscale affect the sprite_width of a sprite_index that is crazy from my point of view because a size should be always a positive number, a wall is of 1 meter not -1 meter if you look at it from the other side. Anyway the problem is simple, if i write into a surface normally using 0,0 how the image_xscale applied to the object will affect the render of the surface ?
Sorry, I would tend to agree with you that sprite_width should be positive, but it's not something we can change now without potentially breaking projects. I'm not entirely sure what you are asking with your final question?
Description
Hi, if you draw a surface from the draw even't of an object that has a sprite assigned to it the surface draw seems to be affected from the image_xscale of the original sprite in the moment it is drawn. Considered the surface has always his origin at 0,0 you should not be affected by the scale of the object.
If i have an object 64x80 with his orign on bottom center and i draw a sprite with xscale 1 or -1 it flip normally but if i draw the same sprite into a surface and after i draw the surface the xscale affect the position of where the object will be drawn because it consider the origin the surface origin at 0,0 and not the sprite origin. A surface should be not affected by the scale of the sprite.
image_index is positive:
image_index is negative:
Steps To Reproduce
Which version of GameMaker are you reporting this issue for?
IDE v2024.8.1.171 Runtime v2024.8.1.218
Which operating system(s) are you seeing the problem on?
Windows 10.0.22631.0
Which platform(s) are you seeing the problem on?
PlayStation 4, PlayStation 5, Switch, Windows, Xbox One & Series X/S
497dba82-0a6d-4073-a654-4ebc041b7f31