- Home /
Question by
thunderinfy · Aug 11, 2020 at 10:16 AM ·
canvasimagesprites
How to get the actual rendered size of sprite in image in canvas?
I have an image inside a canvas (let's call that image as img). img has a sprite that has an actual size of 1080x1620. img.sprite.bounds.size.x returns 10.80 (which is the actual size in units). What I need is the scaled size of the sprite. img.transform.lossyScale.x * 1080 returns 421 px, while the scaled width is close to 384 px (which I checked by subtracting mouse coordinates of the ends).
Comment