bool RenderOnce { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The RenderOnce property of the ScenePanel class in the Sandbox.UI namespace is a boolean property that determines whether the scene should be rendered only once. When set to true, the scene will render a single time. However, it is important to note that the scene will also re-render if the size of the panel changes, even if RenderOnce is enabled.

Usage

To use the RenderOnce property, you can set it to true if you want the scene to render only once initially. This can be useful for static scenes where continuous rendering is not necessary. If the panel's size changes, the scene will automatically re-render to accommodate the new dimensions.

Example

// Create a new ScenePanel
ScenePanel scenePanel = new ScenePanel();

// Set the RenderOnce property to true
scenePanel.RenderOnce = true;

// Add the ScenePanel to the UI
UI.Add(scenePanel);

// The scene will render once, and will re-render if the panel size changes.