CaptureToRenderTexture(VisualElement)
Renders the element's panel and captures the visual content of element into a new RenderTexture sized to the element's pixel bounds.
Read time 1 minuteLast updated 14 days ago
Definition
- Type: Method
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
public static RenderTexture CaptureToRenderTexture(this VisualElement element)
Parameters
The element to capture. It must belong to a panel.
Returns
Type | Description |
|---|---|
| RenderTexture | A new RenderTexture scaled according to the panel. The caller owns the returned texture and is responsible for releasing it with RenderTexture.Release. |
Remarks
This method repaints the whole panel before it captures content.