widget.set_text
Set the HUD widget's text.
Arguments
- text
The text to display. This is a persistent format string.
Example
for each player do script_widget[0].set_visibility(current_player, false) if current_player.number[0] == 1 then script_widget[0].set_visibility(current_player, true) script_widget[0].set_text("You are a zombie!") end end
Notes
-
A HUD widget must display the same format string to all players. If you may need to display completely different text to different players at the same time, you will need to define multiple widgets and manage their visibility and text appropriately.
Some format string parameters make it possible to display different values within a single string, for each player viewing the widget. The hud_player variable is one such parameter.
Only the first 116 characters of the specified string will be displayed; this limitation applies after all format string parameters are substituted in. It seems that the UI reserves room for 117 characters, including an invisible "end of text" marker.