Skip to main content

vgui_screen

vgui_screen icon
Point entity

A vgui_screen shows a menu panel on a rectangle in the world, called a world screen, and players aim at it and click its buttons with fire (the left click). The screen can also show a video. See World screens for layouts, surfaces and animations.

Attributes​

The entity also has these common keys:

KeyDescriptionDefault
Move withSpirit of Half-Lifemovewith

Names the parent, an entity that this one moves and turns with. The entity keeps the place and the angles it has on the parent in the editor. If several entities have the name, the first one counts. A name ending in .1 to .4 puts a sprite or a model that isn't solid on that attachment point of the model of the parent. A solid brush on a parent that turns needs its own origin brush. Moving objects explains it all.

If you leave this key empty, the entity doesn't move with anything.

Axis locksparentflags

Keeps some of the entity's own position or angles instead of following the parent. Add up the values of the axes to keep: 2 for X, 4 for Y, 8 for Z, 16 for pitch, 32 for yaw and 64 for roll. So 112 keeps the entity level. 0 follows the parent on every axis.

Default 0
Panel Namepanelname

Names the layout file ui/scripts/screens/<name>.res, from the game folder or the map's files. The file's WorldScreen section sets the panel's size in pixels, and without a size, the panel is 512 x 256. The entity ignores this key if it has a Movie File.

If you leave this key empty, the game removes the entity, unless it plays a Movie File.

Default example_screen
Movie Filemoviefilename

Names an Ogg Theora video, a .ogv file in video/. The screen shows the video instead of a panel, with no cursor and no clicks.

Movie Loopinglooping

Sets whether the video starts over at its end or stops on its last frame.

  • No (stops on its last frame) (0)
  • Yes (1)
Default No (stops on its last frame) (0)
Movie Volumehealth

Sets how loud the video's sound is, from 0 for silent up to 10 for full volume.

If you leave this key empty or set 0, it is 10.

Default 10
Movie Sound Radiusradius

Sets the distance from the screen at which the video's sound fades out completely, in units.

Default 1250
Surfacesurface

Names a brush entity, such as a func_wall, a func_door, a func_train or a func_rotating. The screen is then drawn on the faces of that entity that have the {screen texture, and it moves with the entity. The vgui_screen then ignores Angles, Width, Height and its own origin.

Widthwidth

Without a Surface, sets the width of the screen in units, to the viewer's right of the origin.

Default 32
Heightheight

Without a Surface, sets the height of the screen in units, above the origin.

Default 32
Input Distanceinputdistance

Sets how far from the screen's surface a player can click it, in units, up to 4096.

Default 128
Show Cursorshowcursor

Sets whether players see a mouse cursor on the screen while they aim at it.

  • Default (yes) (-1)
  • No (0)
  • Yes (1)
Default Default (yes) (-1)

Flags​

1Start Inactive

The screen is hidden and can't be used until you trigger the entity

2Input Disabled

The screen only shows things, so it has no cursor and fire works as usual

4Movie sound everywhere

Every player hears the video's sound at the same volume, from no direction

8Movie without sound

The video plays without sound

Notes​

  • Without a Surface, the origin is the screen's lower-left corner as seen from the front, and the screen faces along its angles
  • With a Surface, one repeat of the {screen texture is the whole panel, and the texture's top-left corner is the panel's top-left corner. If you scale, rotate or shear the texture, the panel stretches the same way. The {screen faces are invisible in the game, and the other faces of the brush entity look as usual
  • A click on a button fires Target, with the player who clicked as the activator. It also fires the target that the key ~<command> names for the command of that button, for example the key ~hello with the value my_relay
  • Secondary fire is the right click, and buttons ignore it
  • A click only counts from a living player who isn't spectating, who is in front of the screen and within Input Distance. Each player's clicks count up to 10 a second
  • On makes the screen active, Off hides it so nobody can use it, and Toggle switches between the two
  • A video plays from the start of the map, or from its beginning each time the screen turns on, and it stops when the screen turns off. Players who join later see it at the same point as the others
  • With Move with, a screen without a Surface rides along and turns with its parent, and each player's game draws it there. A screen with a Surface moves with its brush, so to put it on a moving object, give the brush Move with. See Moving objects

See also​

Changes since 1.38​

  • vgui_screen is new