Material - stingray.Material object reference - Stingray Lua API Reference

stingray.Material object reference

Description

Represents a material.

Functions

Parameters

self :

stingray.Material

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

integer

The ID of the material.

Parameters

self :

stingray.Material

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

variable :

string

The name of the color variable whose value you want to set.

color :

stingray.Quaternion

The new value to set for the variable. This is an ARGB value stored in a Quaternion with each component ranging from 0-255. You can create such a value by calling Color(), passing three arguments for an RGB value or four for an ARGB value. To draw a bright yellow line, for example, you would use Color(255, 255, 0).

Returns
This function does not return any values.
Parameters

self :

stingray.Material

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

variable :

string

The name of the matrix variable whose value you want to set.

value :

stingray.Matrix4x4

The new value to set for the variable.

Returns
This function does not return any values.
Parameters

self :

stingray.Material

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

slot :

string

The name the texture slot which to assign a texture to.

resource :

stingray.RenderResource

The RenderResource to set.

Returns
This function does not return any values.
Parameters

self :

stingray.Material

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

variable :

string

The name of the scalar variable whose value you want to set.

value :

number

The new value to set for the variable.

Returns
This function does not return any values.
Parameters

self :

stingray.Material

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

flag :

string

The name of the shader pass flag.

enabled :

boolean

Use true to enable the shader pass, or false otherwise.

Returns
This function does not return any values.
Parameters

self :

stingray.Material

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

slot :

string

The name the texture slot which to assign a texture to.

texture :

string

The resource name of the texture to set.

Returns
This function does not return any values.
Parameters

self :

stingray.Material

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

variable :

string

The name of the vector variable whose value you want to set.

vector2 :

stingray.Vector3

The new value to set for the variable. Only the X and Y values are used.

Returns
This function does not return any values.
Parameters

self :

stingray.Material

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

variable :

string

The name of the vector variable whose value you want to set.

vector3 :

stingray.Vector3

The new value to set for the variable.

Returns
This function does not return any values.
Parameters

self :

stingray.Material

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

variable :

string

The name of the vector variable whose value you want to set.

vector4 :

stingray.Quaternion

The new value to set for the variable.

Returns
This function does not return any values.