Description
The RenderTexture
property of the ScenePanel
class in the Sandbox.UI
namespace provides access to the texture that the panel is rendering to internally. This texture is dynamically managed and may change if the panel's size changes, so it is not advisable to hold onto this object for extended periods.
Usage
Use the RenderTexture
property to access the current texture being used by the ScenePanel
for rendering. This can be useful for operations that require direct manipulation or inspection of the rendered output. However, be cautious as the texture may change if the panel's dimensions are altered.
Example
// Example of accessing the RenderTexture property
ScenePanel myScenePanel = new ScenePanel();
Texture currentTexture = myScenePanel.RenderTexture;
// Use the texture for some operation
if (currentTexture != null)
{
// Perform operations with currentTexture
}