Represents a material.
Constructors and accessors
stingray.Gui.create_material() stingray.Gui.material() stingray.Mesh.material() stingray.ShadingEnvironment.material() stingray.Terrain.material() |
Related sample code
Other related reference items
id ( self ) : integerRetrieves the ID of the material.
|
self : | 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. |
integer |
The ID of the material. |
set_color ( self, variable, color )Sets a color variable in the material to the specified value.
|
self : | 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 : | 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). |
This function does not return any values. |
set_matrix4x4 ( self, variable, value )Sets a matrix variable in the material to the specified value.
|
self : | 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 : | The new value to set for the variable. |
This function does not return any values. |
set_resource ( self, slot, resource )Sets a resource slot in the material to the specified texture resource.
|
self : | 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 : | The RenderResource to set. |
This function does not return any values. |
set_scalar ( self, variable, value )Sets a scalar variable in the material to the specified value.
|
self : | 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. |
This function does not return any values. |
set_shader_pass_flag ( self, flag, enabled )Determines whether or not the specified shader pass is enabled for the material.
|
self : | 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. |
This function does not return any values. |
set_texture ( self, slot, texture )Sets a texture slot in the material to the specified texture resource.
|
self : | 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. |
This function does not return any values. |
set_vector2 ( self, variable, vector2 )Sets a two-dimensional vector variable in the material to the specified value.
|
self : | 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 : | The new value to set for the variable. Only the X and Y values are used. |
This function does not return any values. |
set_vector3 ( self, variable, vector3 )Sets a three-dimensional vector variable in the material to the specified value.
|
self : | 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 : | The new value to set for the variable. |
This function does not return any values. |
set_vector4 ( self, variable, vector4 )Sets a four-dimensional vector variable in the material to the specified value.
|
self : | 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 : | The new value to set for the variable. |
This function does not return any values. |