Table of Contents

Class ScreenshotUtility

Namespace
Ceres.Gameplay.Capture
Assembly
Ceres.Gameplay.dll
public static class ScreenshotUtility
Inheritance
ScreenshotUtility
Inherited Members

Methods

CaptureActiveRenderTexture(int, int, TextureFormat)

public static Texture2D CaptureActiveRenderTexture(int width, int height, TextureFormat format = 4)

Parameters

width int
height int
format TextureFormat

Returns

Texture2D

CaptureRawScreenshot(Camera, Vector2, int, RenderTextureFormat)

Capture raw screenshot from renderer to a new Texture2D.

public static Texture2D CaptureRawScreenshot(Camera camera, Vector2 size, int depthBuffer = 24, RenderTextureFormat renderTextureFormat = 0)

Parameters

camera Camera
size Vector2
depthBuffer int
renderTextureFormat RenderTextureFormat

Returns

Texture2D

CaptureRawScreenshotAsync(Camera, Vector2, int, RenderTextureFormat, int, Action<Texture2D>, int)

Capture raw screenshot from renderer to a new Texture2D in async.

public static UniTask CaptureRawScreenshotAsync(Camera camera, Vector2 size, int depthBuffer = 24, RenderTextureFormat renderTextureFormat = 0, int delayFrames = 1, Action<Texture2D> onComplete = null, int maxWarmupFrames = 32)

Parameters

camera Camera
size Vector2
depthBuffer int
renderTextureFormat RenderTextureFormat
delayFrames int
onComplete Action<Texture2D>
maxWarmupFrames int

Returns

UniTask

CaptureScreenShotFromScreen()

Capture screenshot to a new Texture2D. Need be called at the end of frame.

public static Texture2D CaptureScreenShotFromScreen()

Returns

Texture2D

CaptureScreenshot(ScreenshotRequest)

public static ScreenshotUtility.ScreenshotHandler CaptureScreenshot(ScreenshotRequest request)

Parameters

request ScreenshotRequest

Returns

ScreenshotUtility.ScreenshotHandler

CaptureScreenshotAsync(ScreenshotRequest)

public static UniTask<ScreenshotUtility.ScreenshotHandler> CaptureScreenshotAsync(ScreenshotRequest request)

Parameters

request ScreenshotRequest

Returns

UniTask<ScreenshotUtility.ScreenshotHandler>

CaptureScreenshotAsync(Action<Texture2D>)

Capture screenshot to a new Texture2D in async. Need be called at the end of frame.

public static UniTask CaptureScreenshotAsync(Action<Texture2D> onComplete)

Parameters

onComplete Action<Texture2D>

Returns

UniTask

GetTextureFormat(RenderTextureFormat)

public static TextureFormat GetTextureFormat(RenderTextureFormat renderTextureFormat)

Parameters

renderTextureFormat RenderTextureFormat

Returns

TextureFormat

ToTexture2D(RenderTexture)

public static Texture2D ToTexture2D(this RenderTexture renderTexture)

Parameters

renderTexture RenderTexture

Returns

Texture2D

ToTexture2DAsync(RenderTexture, Action<Texture2D>)

public static void ToTexture2DAsync(this RenderTexture renderTexture, Action<Texture2D> callback)

Parameters

renderTexture RenderTexture
callback Action<Texture2D>