s&
newspaperAbout
infoAbout s&box newspaperLatest News published_with_changesChanges mapRoadmap monitoringMetrics
gamesGames
sports_esportsBrowse Games rocketDiscover Games
business_centerWorkshop
sports_esportsGames landscapeMaps chairModels textureMaterials apparelClothing constructionMore..
forumForum docsDocs
docsDocumentation dashboardApi Reference schoolTutorials
inputLog in with Steam chevron_leftChange Language
简体中文EnglishРусскийEspañolPortuguês-BrasilDeutsch日本語FrançaisPolskiTürkçe한국어PirateItalianoไทย繁體中文УкраїнськаČeštinaNederlandsMagyarDanskSuomiSvenskaNorskΕλληνικάRomânăБългарскиTiếng ViệtBahasa IndonesiaEspañol-Latinoaméricaالعربية
Api
Classes
RootPanel
chevron_left Classes
class
RootPanel

Constructors

functionsRootPanel

Properties

data_objectIsHighQualityVRdata_objectIsVRdata_objectIsWorldPaneldata_objectPanelBoundsdata_objectRenderedManuallydata_objectScale

Methods

functionsDeletefunctionsOnDeletedfunctionsOnLayoutfunctionsRenderManuallockUpdateBoundslockUpdateScale
RootPanel
A root panel. Serves as a container for other panels, handles things such as rendering.
class Sandbox.UI .account_tree extends Panel
Sandbox.Engine

build Constructors 1

RootPanel ()

data_object Properties 6

IsHighQualityVR
bool
If this panel should be rendered with ~4K resolution.
IsVR
bool
If this panel belongs to a VR overlay
IsWorldPanel
bool
True if this is a world panel, so should be skipped when determining cursor visibility etc
PanelBounds
Rect
Bounds of the panel, i.e. its size and position on the screen.
RenderedManually
bool
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).
Scale
float
The scale of this panel and its children.

functions Methods 6

Delete (immediate)
OnDeleted ()
OnLayout (layoutRect)
RenderManual (opacity)
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.
UpdateBounds (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.
UpdateScale (screenSize)
Work out scaling here. Default is to scale relative to the screen being 1920 wide. ie - scale = screensize.Width / 1920.0f;

Inheritance

Panel
RootPanel
WorldPanel
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.
  • News
  • Docs
  • Metrics
  • FAQ
  • Forum
  • Discord
  • Twitter