s&box docs
API ReferenceSandbox.UI

public class Sandbox.UI.RootPanel : Sandbox.UI.Panel

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

Constructors

Showing 1 constructors

Methods

Showing 6 methods

public virtual void Delete(bool immediate = True)

Parameters

  • immediate: Default: True

public virtual void OnDeleted()

public virtual void OnLayout(Sandbox.Rect layoutRect)

public void RenderManual(float opacity = 1)

Render this panel manually. This gives more flexibility to where UI is rendered, to texture for example. `Sandbox.UI.RootPanel.RenderedManually` must be set to true.

Parameters

  • opacity: Default: 1

protected virtual void UpdateBounds(Sandbox.Rect rect)

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.

protected virtual void UpdateScale(Sandbox.Rect screenSize)

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

Properties

Showing 6 properties

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

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

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

If this panel belongs to a VR overlay

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

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

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

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

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

If set to true this panel won't be rendered to the screen like a normal panel. This is true when the panel is drawn via other means (like as a world panel).

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

The scale of this panel and its children.

Metadata

FieldValue
NamespaceSandbox.UI
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.UI.RootPanel

On this page