UI/Components
Components
There are a few basic components that you can use in your game.
Panel
API Reference: Sandbox.UI.Panel
Panels are the basic building blocks for UI elements. All of the elements below derive from this class. A panel can render, as well as handle events and input, making them very versatile.
Label
API Reference: Sandbox.UI.Label
The Label component is used to display text.
Button
API Reference: Sandbox.UI.Button
Users can click these to invoke an action. These have text, and can optionally have an icon.
Checkbox
API Reference: Sandbox.UI.Checkbox
A Checkbox allows the user to select one or more items from a set. It is ideal for situations where multiple choices are allowed, and it doesn't take up much room.
Image
API Reference: Sandbox.UI.Image
The Image component is used to display a graphic.
TextEntry
API Reference: Sandbox.UI.TextEntry
TextEntry components are used for input fields that allow users to enter text.
WebPanel
API Reference: Sandbox.UI.WebPanel
A WebPanel is used to display web content in your game. This can include HTML content or even whole websites.