- Home /
NGUI - How to disable a UILabel ?
Hi,
I'm using this code to hide a label but it's probably not the best method performance wise. Is there any method to disable the text until next use ?
if(condition..)
Label.text = "Game paused";
else
Label.text = "";
Answer by mdeletrain · Jul 22, 2014 at 02:50 PM
Label.enabled = false; ???
Well it works but then I have to set enabled to true if I want to use them again.
I guess I'm going to keep using text = ""; because it's more convenient. But thanks anyway.
Ins$$anonymous$$d of your if/else, just use :
Label.enabled = (condition..)
And put the default value of your label to "Game paused".
Your answer
Follow this Question
Related Questions
Ngui Text Vertical Scrollbar? 1 Answer
Ngui: how to insert text on a label via javascript? 1 Answer
Having proper text areas in unity? 0 Answers
Color.white not so much white... 3 Answers
height and width of label/box depending on amount of text 2 Answers