Commands/Lua

Reference for console commands, Lua hooks and Lua commands in CS2D.

CS2D Command CS2D Console Commands

CS2D Command hudtxt2

Categories

Parameters

  • player (1-32): id of a player
  • id (0-49): internal text id
  • text (text): the text you want to display
  • x (0-850): x position
  • y (0-480): y position
  • [align] (0,1,2)(optional): horizontal alignment
  • [valign] (0,1,2)(optional): vertical alignment
  • [size] (10-100)(optional): font size/height in pixels, 13 by d

Info

Display or hide a text on the screen of a certain player (as server only).

Just enter the first parameter (id) and leave out all other parameters in order to hide an existing text.

The position in pixels defines the text position on the screen.

The horizontal alignment parameters mean:
0 - left alignment (normal)
1 - center alignment
2 - right alignment

The vertical alignment parameters mean:
0 - top alignment (normal, text will be UNDER the y coordinate)
1 - center alignment
2 - bottom alignment (text will be OVER the y coordinate)

You can also use color-codes (©RRRGGGBBB) at the beginning and in-line! For example: "©255000000This is a red text" or "The following text is ©000000255blue"

Note: The texts/IDs are shared with the hudtxt command!
Note: Each text ID can be used with each player. So every player can have up to 50 individual texts on the screen.
Note: Affected by mp_hudscale

Lua Hook Lua Hooks

Lua Command Lua Commands