Skip to main content

MaterialRect

A struct in Root.Township, Alta.Utilities.Atlas.

A material with its offset and scale inside a texture atlas, and whether mesh UVs need fixing to use it.

Constructors​

MemberWhat it is
MaterialRect(Material material, Vector4 offsetScale, bool needsFixing)Creates a MaterialRect from atlasedMaterial.
MaterialRect(Material material)Creates a MaterialRect from atlasedMaterial.
MaterialRect(AtlasDefinition.AtlasedMaterial atlasedMaterial)Creates a MaterialRect from atlasedMaterial.

Properties​

MemberWhat it is
Material Material { get; }The material.
bool NeedsFixing { get; }True when built from an atlased material, so mesh UVs must be remapped to its area.
Vector4 OffsetScale { get; }Offset (x, y) and scale (z, w) of the material's area in the atlas; zero when not atlased.

Used in​

Members of other types that take, return or hold a MaterialRect: