Table of Contents

Class MaterialFrame

Namespace
RichHudFramework.UI.Rendering
Assembly
RichHudClient.dll

Manages the positioning, scaling, and alignment of a Material on a QuadBoard. Handles calculations for aspect-ratio preservation via UV cropping or geometry scaling.

public class MaterialFrame : IReadOnlyMaterialFrame
Inheritance
MaterialFrame
Implements

Constructors

MaterialFrame()

public MaterialFrame()

Properties

Alignment

The alignment mode determining how the material is scaled or cropped to fit the element's aspect ratio.

public MaterialAlignment Alignment { get; set; }

Property Value

MaterialAlignment

Material

The texture and sprite data associated with the frame.

public Material Material { get; set; }

Property Value

Material

Methods

GetAlignmentScale(float)

Calculates the scaling vector required to resize a billboard to match the material's aspect ratio. Used when the geometry itself should change size rather than cropping the texture.

public Vector2 GetAlignmentScale(float bbAspectRatio)

Parameters

bbAspectRatio float

The current aspect ratio of the billboard.

Returns

Vector2

A scalar vector to apply to the billboard dimensions.

GetMaterialAlignment(float)

Calculates the modified UV (texture) coordinates needed to fit the material to the billboard according to the specified Alignment.

public BoundingBox2 GetMaterialAlignment(float bbAspectRatio)

Parameters

bbAspectRatio float

The aspect ratio (Width/Height) of the target billboard.

Returns

BoundingBox2

A BoundingBox2 representing the Min/Max UV coordinates.