Page 1 of 1

Need some help with formating echoes to a label.

Posted: Wed Jul 21, 2021 3:13 am
by Aydein
I'm curious if I can format my text in a very particular way.

For instance (and I know it's not done this way but just for an idea of what I'm trying to achieve here) "<white>Name: <red> ..fullname"
I'd like to know if it's possible to modify each of these individually. I've been looking through the Geyser labels and what not but everything I've tried so far has only resulted in being able to format a single line in the same way.

Code: Select all

GUI.Stats = Geyser.Label:new({
  name = "GUI.Stats",
  x = "0%", y = "0%",
  width = "100%",
  height = "25%",
},GUI.Left)
GUI.Stats:setStyleSheet(GUI.BoxCSS:getCSS())
local character_stats = {
  "Name " ..fullname,
  "Gold " ..allgold,
  "Undecided "
}
GUI.Stats:echo( table.concat( character_stats, "<br>" ) )

Re: Need some help with formating echoes to a label.

Posted: Wed Jul 21, 2021 4:25 am
by demonnic
You can use font tags (as it's not html5).. so GUI.Stats:echo(f[[<font color="white">Name: <font color="red">{fullname}]])

Re: Need some help with formating echoes to a label.

Posted: Wed Jul 21, 2021 6:58 pm
by Aydein
Thank you so very much and may your children and children's children always find great fortune. So just to throw it out there in case anyone else finds this and is faced with the same lack of coding talent that I've been blessed with - it should have looked like this ( at least this is what made it work for me):
Once again, thank you @demonnic !

Code: Select all

GUI.Stats = Geyser.Label:new({
  name = "GUI.Stats",
  x = "0%", y = "0%",
  width = "100%",
  height = "25%",
},GUI.Left)
GUI.Stats:setStyleSheet(GUI.BoxCSS:getCSS())
local character_stats = {
  "<font color=white>Name <font color=red>" ..fullname,
  "<font color=white>Gold <font color=yellow>" ..allgold,
  "<font color=white>Anything <font color=blue>" ..whatever,
}
GUI.Stats:echo( table.concat( character_stats, "<br>" ) )