Table of Contents

Class ShapeFill

Namespace
Stride.CommunityToolkit.Shapes
Assembly
Stride.CommunityToolkit.Shapes.dll

How a shape's interior is painted. Fill holds one; each draw call captures its values as it is made.

public sealed class ShapeFill
Inheritance
ShapeFill

Remarks

With no Color, the fill is the outline colour dimmed and made translucent by Alpha - the Box2D testbed's formula, kept so the physics examples match it side by side. With a colour, it is that colour at its own alpha times Alpha, which is what a dark panel behind a bright border needs and what the testbed formula cannot produce.

A gradient across the fill is Gradient.

Properties

Alpha

Fill intensity, 0 to 1; 0 leaves an unfilled outline. Defaults to 0.6, the testbed's value.

public float Alpha { get; set; }

Property Value

float

Color

The fill's own colour, or null (the default) to fill with the outline colour, which is what the Box2D testbed does. Set it when the two should differ - a chart marker filled in its series colour but outlined in a neutral one, a bar with a darker edge, a light cursor ring with a dark halo.

public Color? Color { get; set; }

Property Value

Color?

Remarks

The colour is used as given, including its own alpha, with Alpha scaling only its opacity. That differs from the default path, where Alpha also darkens the outline colour the way the testbed does - which would turn a colour you chose deliberately into a muddy version of itself.

Methods

Set(Color?, float)

Sets both at once.

public void Set(Color? color, float alpha = 1)

Parameters

color Color?

The fill's own colour, or null for the outline colour.

alpha float

Fill intensity, 0 to 1.