Dynamic resizing of sprites,where the anchor point for scaling is not at the center

I change the size of sprite dynamic, but i need the sprite change at the image center instead of the left top.
like this example:

Hello @mainblade , how are you doing?

I don’t think we have a way to change the pivot where the transform gets applied in a Sprite.However, you might be able to change the Sprite’s position based on the size change to force the sprite center to stay in the same location.

Here is a sample you can use as a starting point: Sprites Examples | Babylon.js Playground

2 Likes

I think i have got it. The center of the sprite must depend on the correct size of the input image.

2 Likes