This article relates to the game "Team Fortress 2". Click here for more information.

Game text tf: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Robot: Automated text replacement (-\{\|\r +{| class=standard-table))
(its position in the world irrelevant = logical entity)
 
(25 intermediate revisions by 13 users not shown)
Line 1: Line 1:
{{wrongtitle|title=game_text_tf}}
{{LanguageBar}} {{TF2 topicon}}
 
{{screenshot}}
== Entity description ==
{{CD|CTFHudNotify|file1=entity_game_text_tf.cpp}}
[[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]].
{{this is a|logical entity|name=game_text_tf|game=Team Fortress 2}} Similar to {{ent|game_text}}, it is an entity that displays text on players' screens. The text is displayed in a colored box with an optional image texture next to it. This text can be defined directly in the Hammer editor. This entity is suitable for standalone maps, if they are not to be [[VGUI_Documentation#Localization|localized]].
 
{{Warning|Don't use quotation characters (<tt>"</tt>) in the "Text Message" field (not even <tt>\"</tt> 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, you can use two single quotes (<tt><nowiki>''</nowiki></tt>) or detailed quotes (<tt>&ldquo;</tt> and <tt>&rdquo;</tt>).}}
{{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, you use detailed quotes (i.e. <tt>&ldquo;</tt> and <tt>&rdquo;</tt>).}}
{{Warning|This entity will not display when using the TF2 minimal HUD. Use a {{ent|game_text}} or an {{ent|env_screenoverlay}} entity if you have vital information to display.}}
{{clr}}
 
{{Note | This entity will not display when using the TF2 minimal HUD.}}
 
==Availability==
This point [[entity]] is exclusive to Team Fortress 2.


== Keyvalues ==
== Keyvalues ==
*{{KV Targetname}}
{{KV Targetname}}
*'''message'''
{{KV|Message Text|intn=message|string|Message to display onscreen.}}
:<string> Message to display on screen. \n signifies a new line in the text.
{{KV|Icon|intn=icon|string|HUD icon (from <tt>scripts/mod_textures.txt</tt>) to display. Be aware that only entries with "file" or "font" will display, entries with "dfile" do not display unless you prefix them with "d_" (white version) or "dneg_" (black version).}}
*'''icon'''
{{ExpandBox|title=Some Default Icons|
:<string> Hud icon (from mod_textures.res) to display.
*whiteAdditive: Additive White
*'''display_to_team'''
*plus_sign: "+"
:<choices> Audience
*minus_sign: "−"
:{| class=standard-table
*dollar_sign: "$"
! Literal Value || Description
*health_icon: Health Icon
|-
*timer_icon: Timer Icon
| 0 || Everyone
*shield: Shield
|-
*number_0: "0"
| 2 || Red Team Only
*number_1: "1"
|-
*number_2: "2"
| 3 || Blue Team Only
*number_3: "3"
|}
*number_4: "4"
*'''background'''
*number_5: "5"
:<choices> Background Panel Color
*number_6: "6"
:{| class=standard-table
*number_7: "7"
! Literal Value || Description
*number_8: "8"
|-
*number_9: "9"
| 0 || Grey
Additionally, by prefixing internal weapon names (e.g., "pistol" for the {{tfwiki|Pistol}} or "nessieclub" for the {{tfwiki|Nessie's Nine Iron}}) with "d_"/"dneg_", the corresponding weapon icon will be displayed.}}
|-
{{KV|Audience|intn=display_to_team|choices|Filters which team(s) will see this message.}}
| 2 || Red
:* 0 : Everyone
|-
:* 2 : Red Team Only
| 3 || Blue
:* 3 : Blue Team Only
|}
{{KV|Background Panel Color|intn=background|choices|Color of the text panel.}}
:* 0 : Grey
:* 2 : Red
:* 3 : Blue


== Inputs ==
== Inputs ==
*{{I Targetname}}
{{I|Display|Display the message text.}}
*'''Display'''
:Display the message text.
 
== Outputs ==
*{{O Targetname}}
 
[[Category:Team Fortress 2 Entities]]

Latest revision as of 08:56, 30 April 2025

English (en)Translate (Translate)
Nuvola apps ksnapshot.png
This article or section needs a screenshot to help visually convey the subject.
You can upload screenshots at Special:Upload. For help, see Help:Images.
C++ Class hierarchy
CTFHudNotify
CPointEntity
CBaseEntity
C++ entity_game_text_tf.cpp

game_text_tf is a logical entity available in Team Fortress 2 Team Fortress 2. Similar to game_text, it is an entity that displays text on players' screens. The text is displayed in a colored box with an optional image texture next to it. This text can be defined directly in the Hammer editor. This entity is suitable for standalone maps, if they are not to be localized.

Warning.pngWarning:Don't use quotation characters (") in the "Text Message" field (not even \" 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, you can use two single quotes ('') or detailed quotes ( and ).
Warning.pngWarning:This entity will not display when using the TF2 minimal HUD. Use a game_text or an env_screenoverlay entity if you have vital information to display.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Message Text (message) <string>
Message to display onscreen.
Icon (icon) <string>
HUD icon (from scripts/mod_textures.txt) to display. Be aware that only entries with "file" or "font" will display, entries with "dfile" do not display unless you prefix them with "d_" (white version) or "dneg_" (black version).
Some Default Icons 
  • whiteAdditive: Additive White
  • plus_sign: "+"
  • minus_sign: "−"
  • dollar_sign: "$"
  • health_icon: Health Icon
  • timer_icon: Timer Icon
  • shield: Shield
  • number_0: "0"
  • number_1: "1"
  • number_2: "2"
  • number_3: "3"
  • number_4: "4"
  • number_5: "5"
  • number_6: "6"
  • number_7: "7"
  • number_8: "8"
  • number_9: "9"
Additionally, by prefixing internal weapon names (e.g., "pistol" for the Tfwiki favicon.png Pistol or "nessieclub" for the Tfwiki favicon.png Nessie's Nine Iron) with "d_"/"dneg_", the corresponding weapon icon will be displayed.
Audience (display_to_team) <choices>
Filters which team(s) will see this message.
  • 0 : Everyone
  • 2 : Red Team Only
  • 3 : Blue Team Only
Background Panel Color (background) <choices>
Color of the text panel.
  • 0 : Grey
  • 2 : Red
  • 3 : Blue

Inputs

Display
Display the message text.