The RenderToPixmap
method is a static extension method provided by the SandboxToolExtensions
class. It allows rendering the view from a specified SceneCamera
to a Pixmap
object. This method can be executed asynchronously if specified.
The RenderToPixmap
method is a static extension method provided by the SandboxToolExtensions
class. It allows rendering the view from a specified SceneCamera
to a Pixmap
object. This method can be executed asynchronously if specified.
To use the RenderToPixmap
method, you need to have a SceneCamera
and a Pixmap
object ready. You can specify whether the rendering should be done asynchronously by setting the async
parameter to true
or false
.
Example usage:
SceneCamera camera = new SceneCamera();
Editor.Pixmap pixmap = new Editor.Pixmap();
bool async = false;
bool result = SandboxToolExtensions.RenderToPixmap(camera, pixmap, async);
If async
is set to true
, the method will perform the rendering operation asynchronously, which can be useful for non-blocking operations in your application.
SceneCamera camera = new SceneCamera(); Editor.Pixmap pixmap = new Editor.Pixmap(); bool async = false; bool result = SandboxToolExtensions.RenderToPixmap(camera, pixmap, async); if (result) { // Rendering was successful } else { // Handle rendering failure }