Class Objects.Material

Represents a material instance for the texture.

To be used with Objects.GetMaterialByName and Objects.GetMaterialsByObject. Materials are managed in the Tomb Editor's material window. This class is not in any way related to Collision.FloorMaterialType. Name and type setters are not implemented for safety reasons due to low-level nature of the material system.

Functions

Material:GetName() Get this material's unique string identifier.
Material:GetType() Get texture material type of this material.
Material:GetProperty(name) Get a material property value.
Material:SetProperty(name, value) Set a material property value.
Material:ResetProperty(name) Reset a material property to its default value.
Material:IsPropertyPresent(name) Check if this material type has a property with the given name.


Functions

Material:GetName()
Get this material's unique string identifier.

Returns:

    string Name string.
Material:GetType()
Get texture material type of this material.

Returns:

    TextureMaterialType Texture material type.
Material:GetProperty(name)
Get a material property value. Property can be addressed by its name or zero-based slot index.

Parameters:

Returns:

    any Property value, or nil if property is not present. Return type depends on property definition and can be bool, number, Vec2, Vec3, or Color.
Material:SetProperty(name, value)
Set a material property value. Property can be addressed by its name or zero-based slot index.

Parameters:

  • name string Property name.
  • value any Value matching the property's declared type: bool, number, Vec2, Vec3, or Color. Provided value type must match the property type.
Material:ResetProperty(name)
Reset a material property to its default value. Property can be addressed by its name or zero-based slot index.

Parameters:

Material:IsPropertyPresent(name)
Check if this material type has a property with the given name.

Parameters:

Returns:

    bool True if the property with a given name exists for this material.
generated by TEN-LDoc (a fork of LDoc 1.4.6)