- Home /
This question was
closed May 22, 2017 at 04:45 PM by
AlundraFlint.
Question by
AlundraFlint · May 24, 2017 at 07:38 AM ·
unity 2dcanvas2d spritesrecttransformpolygon collider 2d
Scale 2d Sprite collider size to UIImage collider size
I have a 2D Sprite and a UIImage objects, both having same .png as their sprites. What I'm trying to achieve is to get automated polygon collider points for my UIImage, but since it automatically generates the points only for Sprites, I get the points generated for the Sprite, scale them to fit my UImage sizes, and set them to my UIImage collider points. So, my question is how can I calculate the scale needed to achieve this? I tried with two different .png s, and I get different scale numbers for them, (one 19.5, second 25), but can't get the connection between them and texture sizes. If someone knows how they depend on each other, or maybe an easier way to generate polygon collider points for UIImage, please help.
Comment