Skip to content

KernelAPI reference

Class RecordingOverlayCanvas

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

An IOverlayCanvas that keeps a list of the shapes drawn, for tests.

C#
public sealed class RecordingOverlayCanvas : IOverlayCanvas

Inheritance

object ← RecordingOverlayCanvas

Implements

IOverlayCanvas

Constructors

RecordingOverlayCanvas()

C#
public RecordingOverlayCanvas()

Properties

Shapes

The shapes drawn, in order.

C#
public List<RecordingOverlayCanvas.Shape> Shapes { get; }

Property Value

List<RecordingOverlayCanvas.Shape>

Methods

FillCircle(Vector2, float, Color)

Fills a circle.

C#
public void FillCircle(Vector2 center, float radius, Color color)

Parameters

center Vector2

radius float

color Color

FillRect(RectF, Color)

Fills a rectangle.

C#
public void FillRect(RectF rect, Color color)

Parameters

rect RectF

color Color

FillTriangle(Vector2, Vector2, Vector2, Color)

Fills a triangle.

C#
public void FillTriangle(Vector2 a, Vector2 b, Vector2 c, Color color)

Parameters

a Vector2

b Vector2

c Vector2

color Color

Image(PixelImage, RectF, Color)

Draws image stretched over destination without smoothing, multiplied by tint (white keeps its colours; the alpha fades it). Backends keep one texture per image, so the same PixelImage instance should be passed every frame. Canvases that cannot draw images keep the default, which draws nothing.

C#
public void Image(PixelImage image, RectF destination, Color tint)

Parameters

image PixelImage

destination RectF

tint Color

Ring(Vector2, float, float, Color)

A circle outline of the given thickness, drawn inward from radius.

C#
public void Ring(Vector2 center, float radius, float thickness, Color color)

Parameters

center Vector2

radius float

thickness float

color Color

Text(string, Vector2, float, Color)

Short text centred on center, about height pixels tall.

C#
public void Text(string text, Vector2 center, float height, Color color)

Parameters

text string

center Vector2

height float

color Color