I was looking into how to make a white rectangular border around a text item that has mouse focus, but it doesn’t seem very straightforward.
Currently I’m using a textmesh to display Text, but i am not sure if i have to use it particularly.
I’m not really sure whether there are any huge advantages/disadvantages to using textmesh vs manually using UI.label or something in the OnGUI function, but in any case, what I’m trying to do is put a highlight border around the textbox. Is there any built-in component for doing this, or do I need to manually draw lines/ a rectangle behind my text box of the right size?
seems that Outline outlines letters and not the frame.
There is a ‘outline’ component that you can put on your unity 5 UI text objects.
Just for the beginners,
Click on the element that you want to add border (outline) to, in the inspector, scroll down and click on the add component button, search for “outline” and you’ll see the outline component appears, select it and now you can set it’s horizontal and vertical thickness by changing the x and y values.
remember, adding the outline to a text element will actually add a border to the letters not to the whole Text element, if you want a border around your Text element, wrap it in an Image element and set their size equally, and add the outline component to the Image element.
I hope it helped.