c# - Scaling a sprite in unity -
i trying make sprite same proportion screen sizes. there way can scale sprite width , or height compared rest of screen? have tried multiple ways have looked goes on head. there easy way implement this? or way @ in unity? help. here image further trying accomplish.
i want detailed image size of black , green rectangle. help!
i figured out, needed convert pixels per world unit so:
mathf.abs(camera.main.orthographicsize - (getcomponent<spriterenderer>().sprite.texture.height / getcomponent<spriterenderer>().sprite.pixelsperunit));
Comments
Post a Comment