Jump to content
jakeplissken

Text on billboard print from a variable.

Recommended Posts

I am using this example to print procedural text on a billboard, but how do I print text from a variable in the middle of the text? It would be convenient to print the player`s name or something?

 

#(rgb,1024,512,3)text(0,0,"rhs_digital_font", 0.1, "#302c64", "#302cff", "Hello and welcome\nto the server.")

This would be much more useful this way.

  • Like 1

Share this post


Link to post
Share on other sites
_texture = [0, format["#(rgb,512,512,3)text(0, 1, ""PuristaBold"", 0.2, ""#ffffff00"", ""#6aa84f"", Hello %1\nWelcome to\nour server)", name player]];
object setObjectTexture _texture;

Result: https://imgur.com/a/7MVaddX

  • Thanks 2

Share this post


Link to post
Share on other sites
On 2/22/2023 at 7:14 AM, KiloSwiss said:

_texture = [0, format["#(rgb,512,512,3)text(0, 1, ""PuristaBold"", 0.2, ""#ffffff00"", ""#6aa84f"", Hello %1\nWelcome to\nour server)", name player]];
object setObjectTexture _texture;

Result: https://imgur.com/a/7MVaddX

 

This works better.

 

_texture = [0, format["#(rgb,512,512,3)text(0, 1, ""PuristaBold"", 0.1, ""#ffffff00"", ""#6aa84f"", Hello %1\nWelcome to\nour server\n)", profileName, "Gear up and get into the action."]]; 
this setObjectTexture _texture;

 

  • Like 1

Share this post


Link to post
Share on other sites

If you want a variable, you'll have to compile it...

 

call compile format ['blubasewhiteboard setObjectTexture [0,"#(rgb,512,512,3)text(1, 1,""EtelkaMonospacePro"", 0.05, ""#FFFFFF00"", ""#FFFFFFFF"",%1)"]', name alpha_1 + str getplayerscores alpha_1] ;

Y9OPlv8.jpeg

  • Like 3

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×