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.
public interface IViewCaptureProperties
FrameHasUi
Whether the last frame drew a UI view.
bool FrameHasUi { get; }Property Value
Methods
CaptureScreen()
What the player saw: with a UI, the window (letterbox, world, UI over it) at the window’s size; without one, CaptureWorld.
PixelImage CaptureScreen()Returns
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.
PixelImage? CaptureUi()Returns
CaptureWorld()
The last frame’s world view: the canvas, opaque, at the canvas’s size.
PixelImage CaptureWorld()Returns
SaveWorldScreenshot(string)
Writes the world view as a PNG, at the size the platform’s own captures of the canvas have.
void SaveWorldScreenshot(string path)Parameters
path string