Need some help with formating echoes to a label.

Post Reply
Aydein
Posts: 27
Joined: Wed Sep 13, 2017 8:45 pm

Need some help with formating echoes to a label.

Post 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>" ) )

User avatar
demonnic
Posts: 883
Joined: Sat Dec 05, 2009 3:19 pm

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

Post 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}]])

Aydein
Posts: 27
Joined: Wed Sep 13, 2017 8:45 pm

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

Post 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>" ) )

Post Reply