Skip to content

KernelAPI reference

Interface IViewCapture

Namespace: MicroEngine.Core
Assembly: MicroEngine.dll
Guide: Game lifecycle and time

The captures of a platform that has a UI view (IScreenView), a capability of the SDL, raylib and headless platforms (TryGetCapability``1). A run’s captures (SaveScreenshot) show what the player sees: a frame that drew a UI is captured as the window, the world scaled into its frame with the UI view composited over it (CaptureScreen); a frame that drew none is captured as the canvas, as before the UI view existed. Tests that need the world alone read CaptureWorld or write SaveWorldScreenshot.

C#
public interface IViewCapture

Properties

FrameHasUi

Whether the last frame drew a UI view.

C#
bool FrameHasUi { get; }

Property Value

bool

Methods

CaptureScreen()

What the player saw: with a UI, the window (letterbox, world, UI over it) at the window’s size; without one, CaptureWorld.

C#
PixelImage CaptureScreen()

Returns

PixelImage

CaptureUi()

The last frame’s UI view at the window’s size, premultiplied and transparent where nothing was drawn; null when the frame drew none.

C#
PixelImage? CaptureUi()

Returns

PixelImage?

CaptureWorld()

The last frame’s world view: the canvas, opaque, at the canvas’s size.

C#
PixelImage CaptureWorld()

Returns

PixelImage

SaveWorldScreenshot(string)

Writes the world view as a PNG, at the size the platform’s own captures of the canvas have.

C#
void SaveWorldScreenshot(string path)

Parameters

path string