game_text is a point entity available in all Source games. It displays text on players' screens. This text can be defined directly in the Hammer editor (unlike the similar env_message entity which uses the
titles.txt file). This entity is suitable only for standalone bsp maps.
If your text is not displaying properly in a multiplayer game, try checking the "All Players" flag.
\"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.
In code it is represented by class CGameText, defined in maprules.cpp.
- Message Text
- Message to display onscreen. \n signifies a new line in the text. Bug: Hammer will automatically change
/n. The only known workaround is to edit the vmf in notepad.
- X (0 - 1.0 = left to right) (-1 centers)
- 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 (0 - 1.0 = top to bottom) (-1 centers)
- 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.
- Text Effect
- Text scan effect
Literal value Effect Description 0 Fade In/Out The whole text is faded in, and then faded out. 1 Credits To do: 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.
- The primary color used by all the text effects.
- The scanning color for the letter being scanned if the Text Effect keyvalue is set to Scan Out - usually a different shade of Color1.
- Fade in Time (or character scan time)
- The time it should take for the text to fully fade in.
- Fade Out Time
- The time it should take for the text to fade out, after the hold time has expired.
- Hold Time
- The time the text should stay onscreen, after fading in, before it begins to fade out.
- Scan time (scan effect only)
- 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.
- 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.
- 1 : Channel 1
- 2 : Channel 2
- 3 : Channel 3
- 4 : Channel 4
- Legacy support: The name of a master entity. If the master hasn't been activated, this entity will not activate.
- Entity Scripts
- Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.
- Script think function
- Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call. Note: Try to avoid expensive operations in this function, as it may cause performance problems.
- 1 : All Players
- Display the message text.
- Removes this entity from the world.
- Removes this entity and its children from the world. Note: Entities already remove orphaned children upon being removed, but this input removes all children on the same frame, being marginally faster than
- Adds a keyvalue/output to this entity. It can be potentially very dangerous, use with care.
<output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
- Fire the
OnUseroutputs; see User Inputs and Outputs.
- Same as a player invoking +use; may not do anything depending on the entity. Can also be invoked by firing an output that does not specify an input.
- Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
- Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console. Bug: In , the code is executed in the script scope of the entity that fires the output, not the one receiving the input.Warning: Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor.
- Execute a VScript function in the scope of the receiving entity.
- Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.
- Set this entity's angles.
- These outputs each fire in response to the firing of the like-numbered
FireUser4Input; see User Inputs and Outputs.
- This output fires when the entity is killed and removed from the game.