Skip to content

DrawSurfaceLayer

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

A layer whose content is drawn via a callback.

csharp
public record DrawSurfaceLayer : SurfaceLayer, IEquatable<SurfaceLayer>, IEquatable<DrawSurfaceLayer>

Inheritance

ObjectSurfaceLayerDrawSurfaceLayer

Implements

Constructors

DrawSurfaceLayer(Action<Surface>, int, int)

A layer whose content is drawn via a callback.

Parameters:

  • Draw (Action<Surface>): The callback that draws content to the surface.
  • OffsetX (Int32): X offset where the drawn surface's (0,0) will be placed.
  • OffsetY (Int32): Y offset where the drawn surface's (0,0) will be placed.
csharp
public DrawSurfaceLayer(Action<Surface> Draw, int OffsetX = 0, int OffsetY = 0)

Properties

Draw

The callback that draws content to the surface.

Returns: Action<Surface>

csharp
public Action<Surface> Draw { get; init; }

OffsetX

X offset where the drawn surface's (0,0) will be placed.

Returns: Int32

csharp
public int OffsetX { get; init; }

OffsetY

Y offset where the drawn surface's (0,0) will be placed.

Returns: Int32

csharp
public int OffsetY { get; init; }

Remarks

The callback receives a fresh sized to the widget bounds. Use this for dynamic content that needs to be redrawn each frame.

Released under the MIT License.