Game text: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Added apostrophes - they're in the message.)
m (→‎Entity Description: Character code-format.)
Line 4: Line 4:
[[Image:Game text.png|left]]An entity that displays text on player's screens. This text can be defined directly in the Hammer editor (unlike the similar [[env_message]] entity). However, it is recommended that you use [[env_message]] and the corresponding [[titles.txt]] file to aid localisation and maintainability.
[[Image:Game text.png|left]]An entity that displays text on player's screens. This text can be defined directly in the Hammer editor (unlike the similar [[env_message]] entity). However, it is recommended that you use [[env_message]] and the corresponding [[titles.txt]] file to aid localisation and maintainability.


{{Warning|Don't use quotation characters (") in the ''Text Message'' field (not even <code>\"</code> characters) or else [[Hammer]] and the compile tools will misinterpret the character as a termination of the ''Text Message'' argument and fail to interpret the rest of the [[VMF]], resulting in an error: <code>line <line number>: unexpected symbol '<symbol>'</code>. Instead, use one or two consecutive apostrophes. It is also possible to use [[VGUI_Documentation#Localization|localized strings]] or titles.}}
{{Warning|Don't use quotation characters (<code>"</code>) in the ''Text Message'' field (not even <code>\"</code> characters) or else [[Hammer]] and the compile tools will misinterpret the character as a termination of the ''Text Message'' argument and fail to interpret the rest of the [[VMF]], resulting in an error: <code>line <line number>: unexpected symbol '<symbol>'</code>. Instead, use one or two consecutive apostrophes. It is also possible to use [[VGUI_Documentation#Localization|localized strings]] or titles.}}


{{clr}}
{{clr}}

Revision as of 14:35, 10 September 2006

Template:Wrongtitle

Entity Description

Game text.png

An entity that displays text on player's screens. This text can be defined directly in the Hammer editor (unlike the similar env_message entity). However, it is recommended that you use env_message and the corresponding titles.txt file to aid localisation and maintainability.

Warning.pngWarning:Don't use quotation characters (") in the Text Message field (not even \" characters) or else Hammer and the compile tools will misinterpret the character as a termination of the Text Message argument and fail to interpret the rest of the VMF, resulting in an error: line <line number>: unexpected symbol '<symbol>'. Instead, use one or two consecutive apostrophes. It is also possible to use localized strings or titles.

Availability

Template:In game Template:Game-base Template:In code

Keyvalues

<target_destination> Legacy support: The name of a master entity. If the master hasn't been activated, this entity will not activate.
  • message
<string> Message to display onscreen. \n signifies a new line in the text.
  • x
<float> Horizontal position on the player's screens to draw the text. The value should be between 0 and 1, where 0 is the far left of the screen and 1 is the far right. -1 centers the text.
  • y
<float> Vertical position on the player's screens to draw the text. The value should be between 0 and 1, where 0 is the top of the screen and 1 is the bottom. -1 centers the text.
  • effect
<choices> Text Effect.
Literal value Description
0 Fade In/Out
1 Credits
2 Scan Out
  • color
<color255> Color1.
  • color2
<color255> Color2.
  • fadein
<float> The time it should take for the text to fully fade in.
  • fadeout
<float> The time it should take for the text to fade out, after the hold time has expired.
  • holdtime
<float> The time the text should stay onscreen, after fading in, before it begins to fade out.
  • fxtime
<float> If the 'Text Effect' is set to Scan Out, this is the time it should take to scan out all the letters in the text.
  • channel
<choices> Text Channel. You can have up to four individual game_text messages onscreen at once, stored in channels. Select which channel this text should be placed in, which will overwrite any active message already in that channel. (Note that only Channels 1-4 are displayed in the choice list.)
Literal value Description
0 Channel 0
1 Channel 1
2 Channel 2
3 Channel 3
4 Channel 4
5 Channel 5

Flags

  • 1 : All Players

Inputs

Display the message text.

Outputs

Also See

  • env_message - A similar entity that displays already defined messages from titles.txt.
  • point_message - A similar entity that displays a small custom message at a specific position in the game world.