CreateMaterial()

Syntax

Result = CreateMaterial(#Material, TextureID)
Description
Creates a new #Material based on the specified texture. If #PB_Any is used as '#Material' parameter, the new material number will be returned as 'Result'. A valid 'TextureID' can be easily obtained with the TextureID() command.

If the 'Result' is 0, the Material creation has failed. If the #Material was already created, it is automatically freed and replaced by the new one.

Supported OS

Windows, Linux

<- CountMaterialLayers() - Material Index - DisableMaterialLighting() ->