How to color a guilabel

Started by Luis_Labarca, Jun 18, 2017, 12:50 AM

Previous topic - Next topic

Luis_Labarca

ColourRed<-"[#FF0000]"
ColourGreen<-"[#32CD32]"
GuiLabelTest <-null;

function Script::ScriptLoad()
{
::GuiLabelTest <- GUILabel(VectorScreen(0, 0), Colour(255, 255, 255),ColourRed+" TEXT "+ColourGreen+"TESTED " );
::GuiLabelTest.FontSize = 12;
::GuiLabelTest.FontName = "Lucida Console";
}

Hi how can i add color to a GuiLabel probe this code and salts is [#FF0000]TEXT [#32CD32]TESTED

I want it to come out like this TEXT  TESTED
My server RP
IP: 51.222.28.159:8194

Stormeus

::GuiLabelTest.AddFlags(GUI_FLAG_TEXT_TAGS);

EK.IceFlake


Luis_Labarca

Quote from: EK.IceFlake on Jun 18, 2017, 07:55 PM
Quote from: Luis_Labarca on Jun 18, 2017, 12:50 AMprobe this code

I love your word choice. I'm serious.
>:( >:( >:( >:( >:( >:( >:( >:( >:( >:( >:( You suck everything you have to criticize :P :P :P :P :P :P :P :P :P :P :P
My server RP
IP: 51.222.28.159:8194

vito1

Quote from: Stormeus on Jun 18, 2017, 05:38 AM::GuiLabelTest.AddFlags(GUI_FLAG_TEXT_TAGS);
It's not working for label currently.

Stormeus

Make sure you add the tag flag before setting text.

Make sure your tags are lowercase.

EK.IceFlake

Quote from: Luis_Labarca on Jun 18, 2017, 11:34 PM
Quote from: EK.IceFlake on Jun 18, 2017, 07:55 PM
Quote from: Luis_Labarca on Jun 18, 2017, 12:50 AMprobe this code

I love your word choice. I'm serious.
>:( >:( >:( >:( >:( >:( >:( >:( >:( >:( >:( You suck everything you have to criticize :P :P :P :P :P :P :P :P :P :P :P
It's not criticism, I was serious.

vito1

Quote from: Stormeus on Jun 19, 2017, 09:02 AMMake sure you add the tag flag before setting text.

Make sure your tags are lowercase.
Thanks. This one is works.
::GuiLabelTest <- GUILabel();
::GuiLabelTest.AddFlags(GUI_FLAG_TEXT_TAGS);
::GuiLabelTest.Colour = Colour(255,255,255,255);
::GuiLabelTest.Size = VectorScreen(0, 0);
::GuiLabelTest.Position = VectorScreen(200, 200);
::GuiLabelTest.Text = "asf[#ffee00]ewfwe";
::GuiLabelTest.FontSize = 12;
::GuiLabelTest.FontName = "Lucida Console";

Luis_Labarca

My server RP
IP: 51.222.28.159:8194

Luis_Labarca

Quote from: vito1 on Jun 19, 2017, 01:52 PM
Quote from: Stormeus on Jun 19, 2017, 09:02 AMMake sure you add the tag flag before setting text.

Make sure your tags are lowercase.
Thanks. This one is works.
::GuiLabelTest <- GUILabel();
::GuiLabelTest.AddFlags(GUI_FLAG_TEXT_TAGS);
::GuiLabelTest.Colour = Colour(255,255,255,255);
::GuiLabelTest.Size = VectorScreen(0, 0);
::GuiLabelTest.Position = VectorScreen(200, 200);
::GuiLabelTest.Text = "asf[#ffee00]ewfwe";
::GuiLabelTest.FontSize = 12;
::GuiLabelTest.FontName = "Lucida Console";
I had the same problem that did not work I fixed in the maxorator script and I saw that it was the colors with the labels in lowercase ;)
My server RP
IP: 51.222.28.159:8194