- Home /
How can I add a colored border to my text box?
Hello all. I need to differentiate one text box from another in my most recent game. To do this, I figured I would just give each different text box a border. As far as I've seen, I cannot do this. Is there a way?
Cheers, BDconrad
Just add an image element with the same scale and position as your text box.
I can't do that. It tells me that the text box cannot have an image element attache to it. Do you mean a completely separate image element or a component?
I believe what @SohailBukhari is saying is to add an image gameobject and a child of your text gameobject
Answer by hexagonius · Apr 07, 2017 at 02:33 PM
Each gameobject in a canvas hierarchy can only have one rendered component at a time. You need two gameobjects for this. The first (hierarchically first) with the text and with border second. You can use the 9-slice technique to create a border that's not using much space on the sprite. Switch the Image from Simple to Sliced and edit the sprite like this:
Your answer
Follow this Question
Related Questions
Displaying varying text 1 Answer
GUI Overlay Display 0 Answers
Why does the font selected for my GUI Skin not display correctly? 1 Answer
Make accented letters show in text field on Android? 2 Answers
Problem| Player Name Above The Player 2 Answers