API ReferenceSandbox.UI

RootPanelclass

A root panel. Serves as a container for other panels, handles things such as rendering.

objectPanelRootPanel
Namespace
Sandbox.UI
Assembly
Sandbox.Engine
Declaration
public class Sandbox.UI.RootPanel : Sandbox.UI.Panel

Constructors1

Showing 1 constructors

public RootPanel()PUBLICCONSTRUCTOR

A root in the game's UI. This is the one addon code wants.

Methods7

Showing 7 methods

public virtual void Delete(bool immediate = True)PUBLICVIRTUAL

ParameterTypeDescription
immediate = Truebool
Returns:void

public virtual void OnButtonTyped(Sandbox.UI.ButtonEvent e)PUBLICVIRTUAL

Tab and Shift+Tab that nothing below us handled move focus through the tree.

ParameterTypeDescription
eButtonEvent
Returns:void

public virtual void OnDeleted()PUBLICVIRTUAL

Returns:void

public virtual void OnLayout(Sandbox.Rect layoutRect)PUBLICVIRTUAL

ParameterTypeDescription
layoutRectRect
Returns:void

public void RenderManual(float opacity = 1)PUBLIC

Execute the command list prepared during the latest UI update in the current render block. `Sandbox.UI.RootPanel.RenderedManually` must be set to true.

ParameterTypeDescription
opacity = 1floatOpacity multiplier for this execution.
Returns:void

protected virtual void UpdateBounds(Sandbox.Rect rect)PROTECTEDVIRTUALPER-FRAME

Called before layout to lock the bounds of this root panel to the screen size (which is passed). Internally this sets PanelBounds to rect and calls UpdateScale.

ParameterTypeDescription
rectRect
Returns:void

protected virtual void UpdateScale(Sandbox.Rect screenSize)PROTECTEDVIRTUALPER-FRAME

Work out scaling here. Default is to scale relative to the screen being 1920 wide. ie - scale = screensize.Width / 1920.0f;

ParameterTypeDescription
screenSizeRect
Returns:void

Properties7

Showing 7 properties

public bool Sandbox.UI.RootPanel.IsHighQualityVR { get; set; }PUBLICGETSET

If this panel should be rendered with ~4K resolution.

Returns:bool

public bool Sandbox.UI.RootPanel.IsVR { get; set; }PUBLICGETSET

If this panel belongs to a VR overlay

Returns:bool

public virtual bool Sandbox.UI.RootPanel.IsWorldPanel { get; set; }PUBLICVIRTUALGETSET

True if this is a world panel, so should be skipped when determining cursor visibility etc

Returns:bool

public Sandbox.Rect Sandbox.UI.RootPanel.PanelBounds { get; set; }PUBLICGETSET

Bounds of the panel, i.e. its size and position on the screen.

Returns:Rect

public bool Sandbox.UI.RootPanel.RenderedManually { get; set; }PUBLICGETSET

If set to true this panel won't be rendered to the screen like a normal panel. Its command list is still prepared during the UI update for rendering elsewhere.

Returns:bool

public float Sandbox.UI.RootPanel.Scale { get; set; }PUBLICGETSET

The scale of this panel and its children.

Returns:float

public Sandbox.UI.RootPanel.RenderStatistics Sandbox.UI.RootPanel.Stats { get; set; }PUBLICGETSET

Statistics for this root's last completed render, including its most recent command preparation. Returns an immutable snapshot. All values are zero until the root's command list has executed.

Returns:RenderStatistics

On this page