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. At the default Alpha of 1 that is a solid shape in the colour of the draw call. Below 1 the fill is dimmed and made translucent, as in the Box2D testbed; TestbedAlpha is the testbed's value. With a colour, the fill is that colour at its own alpha times Alpha, not dimmed.

A gradient across the fill is Gradient.

Fields

TestbedAlpha

The fill intensity the Box2D testbed draws with. Assign it to Alpha, with no Color, for the testbed look: a bright outline around a dimmed, see-through inside.

public static readonly float TestbedAlpha

Field Value

float

Properties

Alpha

Fill intensity, 0 to 1; 0 leaves an unfilled outline. Defaults to 1, a solid fill.

public float Alpha { get; set; }

Property Value

float

Color

The fill's own colour, or null (the default) to fill with the outline colour. Set it when the two should differ, such as a bar with a darker edge.

public Color? Color { get; set; }

Property Value

Color?

Remarks

The colour is used as given, including its own alpha; Alpha scales only its opacity. Without a colour, Alpha also darkens the outline colour.

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.