Strange sprite autosizing

Hi. I dont know bug this or feature, but observed behavior is strange.

Ok, lets create sprite 55x55 and place it like this.
image

Properties of sprite GO:

Now just change sprite size to 110x55 for 2 and 3 sprites, dont touch position.
And now i see this result:
image

I expect to see 2 and 3 sprites just double his size and fill places to the right. But i see that engine trying to realign sprite after resize? Maybe this behavior changed after include “Slice9” feature in engine?

My point - i dont use Slice9, engine must auto size sprite only for internal purpuses without trying to make any unpredictable operations “machine thinks instead of man”

Today I spent about two hours trying to find why my GOs are not positioned correctly.
Sorry for the inconsistent story, I’m under little sick.
Thx you.

PS doing this in code not in editor …

Are you resizing the sprite or the game object?

I would think the sprite scales about its own centre, not the game objects. If you change the scale of the game object instead, it should respect the offset you’ve given the sprite.

2 Likes

I change one sprite 55x55 to another sprite 110x55 with sprite.play_flipbook("#sprite", self.sprite) call. In past around 1.5 year ago i see no such autosizing issue. Maybe i miss something … or wrong

To be honest it’s behaving the way I would expect - centered in the middle of the sprite. You may have to adjust the position to compensate.

Another way would be to add some padding to the 55px graphic so its the same dimensions as the 110px one.

The sprite position is the center of the sprite, just like @benjames171 wrote.

If the sprite size is changed it will still be positioned with the center of the sprite at the sprite position.

It sounds as if @splashshadow would like to both define another anchor position and some kind of auto arrange behaviour to position one sprite after the other. Neither of which we support at the moment.

1 Like

Ok, now i see my mistake.
Good i define 4 GO for 4 different block sizes and create 4 factories.
Thx.

1 Like

this is easy enough to do with GOs. I do it all the time