0

does anyone know an easy way to keep a sprite's size and position while scaling the canvas size? (zoom in/out). for example, i have a 20x20 bitmap on a canvas, I scaled the canvas to 60%, together with other child comp in it but i want this particular bitmap to retain its size.

4

1 回答 1

1

Scale up the bitmap by the same ammount its parent is scaled down - then it will appear to stay at its original size.

If you set scale on 'canvas' to S then you would set scale on bitmap to 1 divided by S.

So if you set canvas scale to 60% - or 0.6, then bitmap scale should be 1/0.6 or 1.66666666...

于 2013-02-27T06:01:41.393 回答