- Home /
Sprite dynamically resize in one direction only
Hi!
I'm trying to create a button with a background that automatically stretches dynamically with the size of the button.
I've set up the borders of the sprite as follows:
This works for buttons that are larger than the original sprite size, but when the button is smaller than the original image size the image becomes distorted:
Ideally I'd like it if it could scale in the vertical axis, and then stretch according to the borders in the horizontal axis, so the left and right sides of the button are always circular and never look stretched.
Is this possible?
Cheers!
Your answer
Follow this Question
Related Questions
How do I set a sprite to fill the entire screen in UI? 1 Answer
Sprite.Create() only works the first time and eventually causes "Invalid AABB" errors. 2 Answers
Why does Sprite Creator make sprites without alpha channel? 1 Answer
Flickering lines around images with transparency 2 Answers
How to render 3D sprites in front of UI. 0 Answers