Tween Universal scale from center point

289 Views Asked by At

I'm using the Tween Universal to animate my sprites in an Android videogame.

The case is when I use the resize of an scale, it does it using the position of the bottom left (obviously) and I want to do the scale with the center of the image...

How can I achieve this?

Thanks!!

1

There are 1 best solutions below

0
On

Assuming you're using LibGDX and universal tween engine? You must call setOrigin on your sprite to set the origin to the middle otherwise it defaults to the bottom left corner. The origin is used for scaling and rotation.

See here.