• 2D
  • Scale a non-centered sprite from its center

My game uses 2D sprites with their center property disabled for pixel scaling on different monitor resolutions.

I added a sprite scaling effect using a tween, but it scales from the sprite's top left corner since it is not centered. Is there a way to keep the sprite non-centered but to scale it from its actual center?

You would have to do translation in addition to scaling.

Yes, so you would need to do the centering yourself based on the sprite size. So you can get the size like this:

my_sprite.texture.get_size()

So now you know the unscaled size (this function is the dimensions of the texture, not the size on screen). Then based on the new scale you can do some math to move the sprite position into the place you want.