- Home /
Question by
DaiMangouDev · Sep 07, 2016 at 01:43 AM ·
c#sprite
How do i stretch a sprite to fill a space only beyond its border ;without using Unity UI components
Hi, I am attempting to stretch a sprite only beyond its borders to fill a space , using c# and no Unity UI components.
I have no had any luck in accomplishing this.
is there a way to do this ?
sprte.png
(85.1 kB)
Comment
Answer by ArturoSR · Sep 07, 2016 at 03:46 AM
Hello there, you need to calculate the size of the sprite using the screen size to fill the desired space:
Vector2 screenSize = new Vector2 (Screen.width, Screen.height)
Using this you can resize any sprite, cheers.
this doesn't stretch the sprite only beyond the borders
Your answer
![](https://koobas.hobune.stream/wayback/20220612092320im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Adding depth to a sprite. 0 Answers
detect Gameobject which is created from c# 1 Answer
Implementing 2D Sprite Collisions 1 Answer