Struct Material
- Namespace
- BSGameLib.Game
- Assembly
- BSGameLib.Game.dll
Identifies a material registered with ShaderManager. Custom materials can be created via Create(string).
public readonly record struct Material : IComparable<Material>, IEquatable<Material>
- Implements
- Inherited Members
- Extension Methods
Properties
Id
Unique identifier for the material.
public string Id { get; }
Property Value
ImmediateSprite
Sprites drawn straight to the render device, not through a batch.
public static Material ImmediateSprite { get; }
Property Value
IsValid
Whether the material has an id. A default Material is not valid.
public bool IsValid { get; }
Property Value
Lit
A sprite drawn with the scene's ambient colour and point lights.
public static Material Lit { get; }
Property Value
None
A placeholder with no shader. The sprite batch renderer uses it to mean that no material is set yet.
public static Material None { get; }
Property Value
Shape
The material that shapes are drawn with.
public static Material Shape { get; }
Property Value
Unlit
A sprite drawn without lighting.
public static Material Unlit { get; }
Property Value
Veil
A sprite laid over a lit scene that light clears instead of brightening: mist, smoke, a colour wash. It takes the ambient colour as a lit sprite does, so it darkens with the scene, and thins where point lights fall, so what is under a light shows through it.
public static Material Veil { get; }
Property Value
Methods
CompareTo(Material)
Orders materials by their ids.
public int CompareTo(Material other)
Parameters
otherMaterial
Returns
Create(string)
Creates a material with a custom id, to register with ShaderManager.
public static Material Create(string id)
Parameters
idstring
Returns
Exceptions
- ArgumentException
idis blank.
ToString()
The material's id.
public override string ToString()
Returns
Operators
operator >(Material, Material)
Whether left sorts after right, by id.
public static bool operator >(Material left, Material right)
Parameters
Returns
operator >=(Material, Material)
Whether left sorts after or equal to right, by id.
public static bool operator >=(Material left, Material right)
Parameters
Returns
operator <(Material, Material)
Whether left sorts before right, by id.
public static bool operator <(Material left, Material right)
Parameters
Returns
operator <=(Material, Material)
Whether left sorts before or equal to right, by id.
public static bool operator <=(Material left, Material right)