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

Methods6

Showing 6 methods

public virtual void Delete(bool immediate = True)PUBLICVIRTUAL

ParameterTypeDescription
immediate = Truebool
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

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.

ParameterTypeDescription
opacity = 1float
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

Properties6

Showing 6 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. This is true when the panel is drawn via other means (like as a world panel).

Returns:bool

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

The scale of this panel and its children.

Returns:float

On this page