Thursday, September 10, 2015

Unity Gui Image Sliced type - not working

This seems so easy. I watched some tutorial on it months ago and implemented my buttons then. Not at first realizing that they did not look as they should.

My buttons have ended up Square at the corners, yet I wanted them nicely rounded. Check out the Square cornered buttons I have.


Searching the web I found lots of people having issues like mine, or similar, only none of the answers seemed correct for me, or I could not interpret them correctly. Then I found this page...
http://answers.unity3d.com/questions/874743/9-sliced-image-in-the-ui-46-not-working-as-expecte.html

On there I could see and read that this person had exactly the same issue as me.I had to read it several times before I understood his own answer to the problem. It comes down to a setting in the Canvas itself.. which surprised me as I had been focused in the wrong place... the artwork for my rounded button. Below is a screenshot of what on the canvas needs to be altered. (I clicked on the Canvas and opened the component called 'Canvas Scaler'. In there I have a value of 1. This is BAD. I am not certain why it is bad, but I played with this value and Lo and Behold it rounded my corners.


As you can see that appears to be nothing special, but changing it to a bigger value such as 50 or 100 allowed my rounded corners to show up as you can witness in the image below.

 


Phew, one long standing problem sorted, who's next?

Da Voodoochief

No comments:

Post a Comment