The RenderTarget
property in the Sandbox.Graphics
class allows you to get or set the current render target. When you set this property, it binds the specified render target and adjusts the viewport to match the dimensions of the render target.
The RenderTarget
property in the Sandbox.Graphics
class allows you to get or set the current render target. When you set this property, it binds the specified render target and adjusts the viewport to match the dimensions of the render target.
To use the RenderTarget
property, simply assign it a RenderTarget
object. This will automatically bind the render target and adjust the viewport accordingly. You can also retrieve the current render target by accessing this property.
// Example of setting a render target RenderTarget myRenderTarget = new RenderTarget(); Graphics.RenderTarget = myRenderTarget; // Example of getting the current render target RenderTarget currentRenderTarget = Graphics.RenderTarget;