StephenNYC
StephenNYC

Reputation: 1264

keep sprite's original size when scaling canvas

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.

Upvotes: 0

Views: 147

Answers (1)

user1901867
user1901867

Reputation:

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...

Upvotes: 1

Related Questions