Table of Contents

Class GradientMesh

Namespace
BSGameLib.UI.Controls
Assembly
BSGameLib.UI.dll

One control's tessellation of a Gradient into colored triangles, cached against the rect it was built for.

public sealed class GradientMesh
Inheritance
GradientMesh
Inherited Members

Remarks

Separate from Gradient because a gradient is shared - it comes from the theme's resource set, and several controls of different sizes may use the same one. The mesh is per-control, rebuilt only when that control's bounds actually change, so a static screen tessellates once and then re-submits the same buffers every frame.

Constructors

GradientMesh(Gradient)

Creates a mesh that draws gradient.

public GradientMesh(Gradient gradient)

Parameters

gradient Gradient

Properties

Gradient

The gradient the mesh draws.

public Gradient Gradient { get; }

Property Value

Gradient

Methods

Draw(IRenderEncoderScope, Rectangle)

Draws the gradient over bounds. Nothing is drawn when the bounds are empty or the gradient has no stops.

public void Draw(IRenderEncoderScope encoder, Rectangle bounds)

Parameters

encoder IRenderEncoderScope
bounds Rectangle