Material

Stores data and properties for an individual material.

About

You can only create and access materials through the MaterialManager.

Summary
MaterialStores data and properties for an individual material.
Member Functions
SetType
GetType
SetSpecial
GetSpecial
Material Related Constants
C_MATERIAL_TYPE_CONSTANTS
C_MATERIAL_TYPE_NONEMeans invalid material.
C_MATERIAL_TYPE_NORMALThe default.
C_MATERIAL_TYPE_VERTICAL_LADDERFor designating shapes as ladders.
C_MATERIAL_TYPE_WARPFor designating shapes as warps.
C_MATERIAL_TYPE_DUMMYFor tweaking sorting and smart shadows.
C_MATERIAL_SPECIAL_CONSTANTS
C_MATERIAL_SPECIAL_NONEDefault, no special properties.

Member Functions

SetType

nil SetType(number materialType)

Sets what kind of basic behavior this should have.  For properties like ladders and warps, you need to set this.  This is done for you in setup_constants.lua.

Parameters

materialTypeShould be sent one of the C_MATERIAL_TYPE_CONSTANTS.

GetType

number GetType()

Returns

One of the C_MATERIAL_TYPE_CONSTANTS.

SetSpecial

nil SetSpecial(number materialSpecial)

Sets extra properties for a material.  Not really used yet, but might be useful for designating special kinds of collisions later.

Parameters

materialSpecialShould be sent one of the C_MATERIAL_SPECIAL_CONSTANTS.

GetSpecial

number GetSpecial()

Returns

One of the C_MATERIAL_SPECIAL_CONSTANTS.

Material Related Constants

Summary
C_MATERIAL_TYPE_CONSTANTS
C_MATERIAL_TYPE_NONEMeans invalid material.
C_MATERIAL_TYPE_NORMALThe default.
C_MATERIAL_TYPE_VERTICAL_LADDERFor designating shapes as ladders.
C_MATERIAL_TYPE_WARPFor designating shapes as warps.
C_MATERIAL_TYPE_DUMMYFor tweaking sorting and smart shadows.
C_MATERIAL_SPECIAL_CONSTANTS
C_MATERIAL_SPECIAL_NONEDefault, no special properties.

C_MATERIAL_TYPE_CONSTANTS

C_MATERIAL_TYPE_NONE

Means invalid material.  Signals a zone with no data when using GetWallByRay()

C_MATERIAL_TYPE_NORMAL

The default.  Just a normal thing you can bump into.  Any other material type will not perform real collisions, just report them.

C_MATERIAL_TYPE_VERTICAL_LADDER

For designating shapes as ladders.  Defined in setup_constants.lua and used in the treeworld scripts.

C_MATERIAL_TYPE_WARP

For designating shapes as warps.  Defined in setup_constants.lua and used in the treeworld scripts.

C_MATERIAL_TYPE_DUMMY

For tweaking sorting and smart shadows.  The engine completely ignores it for collision but will still calculate the depth dot (lowest point of collision) and shadow information based on it.  Good for tweaking those things, make sure it’s the first line in a collision shape.

C_MATERIAL_SPECIAL_CONSTANTS

C_MATERIAL_SPECIAL_NONE

Default, no special properties.

This object stores all the information about materials in the game.