Point worldtext: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(TF2 parses newlines in the text message and also supports alpha, also updated formatting for consistency)
Line 3: Line 3:
[[File:Point worldtext csgo example.jpg|thumb|right|Example text generated by two point_worldtext entities]] It is an entity that displays a text message oriented in the world, at its origin.
[[File:Point worldtext csgo example.jpg|thumb|right|Example text generated by two point_worldtext entities]] It is an entity that displays a text message oriented in the world, at its origin.
== Usage ==
== Usage ==
{{todo|Update this description for {{tf2}}, which has a completely different implementation.}}
'''point_worldtext''' displays a specified text message in a set position in the world. It can be of any size and color, but the text outline cannot be changed. You can change the text message in-game by firing [[AddOutput]] with the parameter "message" and then the message you want to display. One downside of this text type is that it's stationary in the world and it is not part of the HUD, so you can't ensure that all players see it at all times. If you want to display important information that the player(s) must be constantly aware of, then it is better to use a [[game_text]].
'''point_worldtext''' displays a specified text message in a set position in the world. It can be of any size and color, but the text outline cannot be changed. You can change the text message in-game by firing [[AddOutput]] with the parameter "message" and then the message you want to display. One downside of this text type is that it's stationary in the world and it is not part of the HUD, so you can't ensure that all players see it at all times. If you want to display important information that the player(s) must be constantly aware of, then it is better to use a [[game_text]].


Line 12: Line 14:
{{ScrollBox|title=Text Options|}}
{{ScrollBox|title=Text Options|}}
{{KV|Entity Message|intn=message|string|Text that should be displayed.}}
{{KV|Entity Message|intn=message|string|Text that should be displayed.}}
{{KV|Text Size|intn=textsize|float|Size of the text.  Setting this to 0 will display nothing. Negative values will flip the text upside down.}}
{{KV|Text Size|intn=textsize|float|Size of the text.  Setting this to 0 will display nothing. Negative values will flip the text upside down. {{tf2}} Newlines can be inserted into the text via the newline character ''\n''.}}
{{KV|Color|intn=color|Color255|Color of the text.}}
{{KV|Color|intn=color|Color255|Color of the text. {{tf2}} Alpha is also parsed if R G B A format is specified. Otherwise, alpha defaults to 255.}}
{{KV|Font|intn=font|material|Path to the font material sheet|only={{P2CE}}|also={{tf2}}}}
{{KV|Font|intn=font|material|Path to the font material sheet|only={{P2CE}}{{tf2}}}}
:{{todo|Add font gallery for {{tf2}}.  Accepts integer values 0 - 11}}
:{{todo|Add font gallery for {{tf2}}.  Accepts integer values 0 - 11}}
{{KV|Orientation|intn=orientation|int|*0: stationary text
{{KV|Orientation|intn=orientation|int|*0: stationary text
*1: always face the player.   
*1: always face the player.   
*2: ignores pitch (looking up/down)|only={{tf2}}}}
*2: ignores pitch (looking up/down)|only={{tf2}}}}
{{warning|"stationary" text (aka <code>orientation 0</code>) is not centered at origin like other values.  Instead, the first character in the message is printed at origin.  This will cause your text to "shift" switching to/from 0}}
{{KV|Text Spacing X|intn=textspacingx|float|Spacing between each letter along the X axis.  Negative values will invert the text.|only={{tf2}}}}
{{KV|Text Spacing X|intn=textspacingx|float|Spacing between each letter along the X axis.  Negative values will invert the text.|only={{tf2}}}}
{{KV|Text Spacing Y|intn=textspacingy|float|Spacing between each letter along the Y axis.  Only used when newlines are inserted into the text.|only={{tf2}}}}
{{KV|Rainbow|intn=rainbow|bool|Enables rainbow text.  Cannot be modified by <code>color</code> or <code>SetColor</code> inputs.|only={{tf2}}}}
{{KV|Rainbow|intn=rainbow|bool|Enables rainbow text.  Cannot be modified by <code>color</code> or <code>SetColor</code> inputs.|only={{tf2}}}}
<!--{{KV|Text Spacing Y|intn=textspacingy|float|Spacing between each letter along the Y axis.|only={{tf2}}}}
:{{todo|How does this keyvalue work? this entity seemingly only displays one line at a time.}}-->


== Flags ==
== Flags ==
*1: Start Disabled
*1: Start Disabled
{{Bug|{{tf2}}Enable/Disable inputs do not affect text visibility. Setting this flag means the text will never display}}
{{Note|{{tf2}} Doesn't exist.}}
::{{workaround|set the <code>textsize</code> keyvalue to 0 and use the <code>SetTextSize</code> input to toggle visibility, or leave <code>message</code> empty and use the <code>SetText</code> input.}}
::{{workaround|Set the alpha to 0 via ''SetColor''.}}


== Inputs ==
== Inputs ==
{{I BaseEntity|l4d2=1|portal2=1}}
{{I BaseEntity|l4d2=1|portal2=1}}
{{ScrollBox|title=point_worldtext|}}
{{ScrollBox|title=point_worldtext|}}
{{IO|Enable|Start displaying the message text.}}
{{IO|Enable|Start displaying the message text.|not={{tf2}}}}
{{IO|Disable|Stop displaying the message text.}}
{{IO|Disable|Stop displaying the message text.|not={{tf2}}}}
{{Bug|{{tf2}}Enable/Disable inputs do not affect text visibility.  Use the <code>SetTextSize</code> or <code>SetText</code> inputs instead.}}
{{IO|SetMessage|Set the message text.|param=string|not={{tf2}}}}
{{IO|SetMessage|Set the message text.|param=string}}
{{Bug|Does not work, use '''<code>[[AddOutput]] Message <string></code>''' instead.}}
{{Bug|Does not work, use '''<code>[[AddOutput]] Message <string></code>''' instead.}}
{{IO|SetText|only={{tf2}}|param=string|Set the message text.}}
{{IO|SetText|only={{tf2}}|param=string|Set the message text.}}
{{IO|SetTextSize|only={{tf2}}|param=float|Set the message text size.  Setting this to 0 will hide the text.  Negative values will flip the text upside down.}}
{{IO|SetTextSize|only={{tf2}}|param=float|Set the message text size.  Setting this to 0 will hide the text.  Negative values will flip the text upside down.}}
{{IO|SetTextSpacingX|only={{tf2}}|param=float|Set the spacing between letters along the X axis.  Negative values will invert the text.}}
{{IO|SetTextSpacingX|only={{tf2}}|param=float|Set the spacing between letters along the X axis.  Negative values will invert the text.}}
<!--{{IO|SetTextSpacingY|only={{tf2}}|param=float|Set the spacing between letters along the Y axis.}}
{{IO|SetTextSpacingY|only={{tf2}}|param=float|Set the spacing between letters along the Y axis. Only used when newlines are inserted into the text.}}
:{{todo|How does this input work? this entity seemingly only displays one line at a time.}}-->
{{IO|SetColor|only={{tf2}}|param=color255|Set the message color.}}
{{IO|SetColor|only={{tf2}}|param=color255|Set the message color.}}
{{IO|SetFont|only={{tf2}}|param=int|Set the message font.  Accepts values 0 - 11}}
{{IO|SetFont|only={{tf2}}|param=int|Set the message font.  Accepts values 0 - 11}}
{{IO|SetOrientation|only={{tf2}}|param=int| Set the message orientation}}
{{IO|SetOrientation|only={{tf2}}|param=int| Set the message orientation}}
{{warning|"stationary" text (aka <code>orientation 0</code>) is not centered at origin like other values.  Instead, the first character in the message is printed at origin.  This will cause your text to "shift" switching to/from 0}}
{{IO|SetRainbow|only={{tf2}}|param=int| Enables Rainbow Text}}
{{IO|SetRainbow|only={{tf2}}|param=int| Enables Rainbow Text}}
   
   

Revision as of 07:14, 3 December 2022

point_worldtext is a point entity available in Counter-Strike: Global Offensive Counter-Strike: Global Offensive. It is also available in Team Fortress 2 Team Fortress 2.

Example text generated by two point_worldtext entities

It is an entity that displays a text message oriented in the world, at its origin.

Usage

Todo: Update this description for Team Fortress 2, which has a completely different implementation.

point_worldtext displays a specified text message in a set position in the world. It can be of any size and color, but the text outline cannot be changed. You can change the text message in-game by firing AddOutput with the parameter "message" and then the message you want to display. One downside of this text type is that it's stationary in the world and it is not part of the HUD, so you can't ensure that all players see it at all times. If you want to display important information that the player(s) must be constantly aware of, then it is better to use a game_text.

Tip.pngTip:The texture sheet has a bone icon assigned to the "~" character.
Note.pngNote: Text, size and color can be edited real time via AddOutput, making this entity very flexible and useful.

Keyvalues

Text Options:
Entity Message (message) <string>
Text that should be displayed.
Text Size (textsize) <float>
Size of the text. Setting this to 0 will display nothing. Negative values will flip the text upside down. Team Fortress 2 Newlines can be inserted into the text via the newline character \n.
Color (color) <color255>
Color of the text. Team Fortress 2 Alpha is also parsed if R G B A format is specified. Otherwise, alpha defaults to 255.
Font (font) <material> (only in Portal 2: Community EditionTeam Fortress 2)
Path to the font material sheet
Todo: Add font gallery for Team Fortress 2. Accepts integer values 0 - 11
Orientation (orientation) <integer> (only in Team Fortress 2)
  • 0: stationary text
  • 1: always face the player.
  • 2: ignores pitch (looking up/down)
Warning.pngWarning:"stationary" text (aka orientation 0) is not centered at origin like other values. Instead, the first character in the message is printed at origin. This will cause your text to "shift" switching to/from 0
Text Spacing X (textspacingx) <float> (only in Team Fortress 2)
Spacing between each letter along the X axis. Negative values will invert the text.
Text Spacing Y (textspacingy) <float> (only in Team Fortress 2)
Spacing between each letter along the Y axis. Only used when newlines are inserted into the text.
Rainbow (rainbow) <boolean> (only in Team Fortress 2)
Enables rainbow text. Cannot be modified by color or SetColor inputs.

Flags

  • 1: Start Disabled
Note.pngNote:Team Fortress 2 Doesn't exist.
PlacementTip.pngWorkaround:Set the alpha to 0 via SetColor.

Inputs

point_worldtext:
Enable  (not in Team Fortress 2)
Start displaying the message text.
Disable  (not in Team Fortress 2)
Stop displaying the message text.
SetMessage <stringRedirectInput/string> (not in Team Fortress 2)
Set the message text.
Icon-Bug.pngBug:Does not work, use AddOutput Message <string> instead.  [todo tested in ?]
SetText <stringRedirectInput/string> (only in Team Fortress 2)
Set the message text.
SetTextSize <floatRedirectInput/float> (only in Team Fortress 2)
Set the message text size. Setting this to 0 will hide the text. Negative values will flip the text upside down.
SetTextSpacingX <floatRedirectInput/float> (only in Team Fortress 2)
Set the spacing between letters along the X axis. Negative values will invert the text.
SetTextSpacingY <floatRedirectInput/float> (only in Team Fortress 2)
Set the spacing between letters along the Y axis. Only used when newlines are inserted into the text.
SetColor <color255RedirectInput/color32> (only in Team Fortress 2)
Set the message color.
SetFont <integerRedirectInput/integer> (only in Team Fortress 2)
Set the message font. Accepts values 0 - 11
SetOrientation <integerRedirectInput/integer> (only in Team Fortress 2)
Set the message orientation
SetRainbow <integerRedirectInput/integer> (only in Team Fortress 2)
Enables Rainbow Text

Outputs

See also

  • point_message - A similar entity which displays a small custom message at a specific position in the game world.