Game text: Difference between revisions
Jump to navigation
Jump to search
Warning:Don't use quotation characters (") in the Text Message field (not even
mNo edit summary |
m (minor tidy & added ''See also'' link) |
||
Line 1: | Line 1: | ||
{{wrongtitle|title=game_text}} | {{wrongtitle|title=game_text}} | ||
==Entity | == Entity description == | ||
[[Image:Game text.png|left]]An entity that displays text on players' screens. This text can be defined directly in the Hammer editor (unlike the similar [[env_message]] entity). This entity is suitable for stand alone bsp maps, if they are not to be [[VGUI_Documentation#Localization|localized]]. | [[Image:Game text.png|left]]An entity that displays text on players' screens. This text can be defined directly in the Hammer editor (unlike the similar [[env_message]] entity). This entity is suitable for stand alone bsp maps, if they are not to be [[VGUI_Documentation#Localization|localized]]. | ||
{{Warning|Don't use quotation characters (") in the ''Text Message'' field (not even <code>\"</code> characters). It will cause fatal errors with opening and/or compiling your map and may need to be fixed by manually editing the [[VMF]] in a text editor. Instead, use use detailed quotes (i.e. < | {{Warning|Don't use quotation characters (") in the ''Text Message'' field (not even <code>\"</code> characters). It will cause fatal errors with opening and/or compiling your map and may need to be fixed by manually editing the [[VMF]] in a text editor. Instead, use use detailed quotes (i.e. <code>“</code> and <code>”</code>).}} | ||
{{clr}} | {{clr}} | ||
==Availability== | == Availability == | ||
{{in game|point}} {{game-base}}. <br> | {{in game|point}} {{game-base}}. <br> | ||
Does not function in Counter-Strike Source. | Does not function in Counter-Strike Source. | ||
{{in code|class=class_c_game_text.html CGameText|file=maprules_8cpp-source.html maprules.cpp}} | {{in code|class=class_c_game_text.html CGameText|file=maprules_8cpp-source.html maprules.cpp}} | ||
==Keyvalues== | == Keyvalues == | ||
*{{kv targetname}} | *{{kv targetname}} | ||
*'''master''' | *'''master''' | ||
Line 65: | Line 65: | ||
|} | |} | ||
==Flags== | == Flags == | ||
*1 : All Players | *1 : All Players | ||
==Inputs== | == Inputs == | ||
*{{i targetname}} | *{{i targetname}} | ||
*'''Display''' | *'''Display''' | ||
:Display the message text. | :Display the message text. | ||
==Outputs== | == Outputs == | ||
*{{o targetname}} | *{{o targetname}} | ||
== | == See also == | ||
* [[env_message]] - A similar entity that displays already defined messages from <code>titles.txt</code>. | * [[env_message]] - A similar entity that displays already defined messages from <code>titles.txt</code>. | ||
* [[point_message]] - A similar entity that displays a small custom message at a specific position in the game world. | * [[point_message]] - A similar entity that displays a small custom message at a specific position in the game world. | ||
* [[Customizable triggered HUD-message]] - How to create a new entity that is similar to '''game_text''' but can receive the message string via a triggered input. | |||
[[Category:Entities]] | [[Category:Entities]] |
Revision as of 16:38, 25 February 2008
Entity description
An entity that displays text on players' screens. This text can be defined directly in the Hammer editor (unlike the similar env_message entity). This entity is suitable for stand alone bsp maps, if they are not to be localized.

\"
characters). It will cause fatal errors with opening and/or compiling your map and may need to be fixed by manually editing the VMF in a text editor. Instead, use use detailed quotes (i.e. “
and ”
).Availability
Template:In game Template:Game-base.
Does not function in Counter-Strike Source.
Template:In code
Keyvalues
- Template:Kv targetname
- master
- <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 Effect Description 0 Fade In/Out The whole text is faded in, and then faded out. 1 Credits Todo: Unknown - seems to act like Fade In/Out. Provide description.2 Scan Out The text is scanned in letter by letter, and the whole text is then faded out.
- color
- <color255> Color1 - The primary color used by all the text effects.
- color2
- <color255> Color2 - The scanning color for the letter being scanned if the Text Effect keyvalue is set to Scan Out - usually a different shade of Color1.
- 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: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
- Template:I targetname
- Display
- Display the message text.
Outputs
See also
- 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.
- Customizable triggered HUD-message - How to create a new entity that is similar to game_text but can receive the message string via a triggered input.