文档

Unity Engine


User Manual

Script Reference

Unity Engine


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.
阅读时间1 分钟最后更新于 1 个月前

Definition

public static RenderTexture CaptureToRenderTexture(this VisualElement element)

Parameters

The element to capture. It must belong to a panel.

Returns

Type

Description

RenderTextureA 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.