[Bug] GUILabel().Text color not changing.


  • Full Member
  • Posts: 101
[Bug] GUILabel().Text color not changing.
«  »Last edited
GUILabel().Text color not updating/reseting after text change.


How to reproduce:

Code: [Select]
Label <- GUILabel();
Label.TextColour = Colour(255, 255, 255, 255);
Label.FontFlags = GUI_FFLAG_BOLD;
Label.Text = "[#ff00ff]purple colored text";
//Example 2: "purple colored [#ff00ff]text";

After this, change the GUILabel().Text value:
Code: [Select]
Label.Text = "purple colored text";
Code: [Select]
Label.Text = "purple colored[#ffffff0] text";
Even putting a color or not, the text color will not change or will not change correctly.

I realized the test using a client-side /execc.

Mohamed Boubekri

  • Sr. Member
  • In-Game Name:- We3da^
  • Posts: 265
[Bug] Re: GUILabel().Text color not changing.
« Reply #1,  »Last edited
Actually, you can avoid that, like :-
Set the label null //// hide the label
label.label = null; //// like that
And after you set it null create it again and change the color.
After all this pain, peace will come brother.


  • LU Developer
  • Posts: 32
[Bug] Re: GUILabel().Text color not changing.
« Reply #2,  »
It's not really a bug per se, MGUIs intended behaviour is to continue with the defined colour until you close the colour tag using '[#d]'. So to conform to what MGUI is looking for, it should be:

Code: [Select]
Label.Text = "[#ff00ff]purple colored text[#d]";

then when you change the text, you can just do:

Code: [Select]
Label.Text = "non-purple colored text";

and the line will be the default colour.

Hope this helps.