wiki.sine.space | sinespace

Difference between revisions of "Scripting/SMaterial"

From wiki.sine.space
Jump to: navigation, search
(Members)
(Members)
Line 6: Line 6:
 
{{ScriptFunction|void|SetColor32|(string name, byte r, byte g, byte b, byte a);|Sets a shader colour to value (32-bit, 0..255 values)}}
 
{{ScriptFunction|void|SetColor32|(string name, byte r, byte g, byte b, byte a);|Sets a shader colour to value (32-bit, 0..255 values)}}
 
{{ScriptFunction|void|SetInt|(string name, int value);|Sets a shader property to value}}
 
{{ScriptFunction|void|SetInt|(string name, int value);|Sets a shader property to value}}
{{ScriptFunction|void|SetTexture|(string name, SResource texture);|Sets a texture to one provided by a resource|5 = function hithere()<br>
+
{{ScriptFunction|void|SetTexture|(string name, SResource texture);|Sets a object's specified texture map (specified in parameter 1) to the texture provided as a resource in parameter #2|5 = function hithere()<br>
 
   image = "mrlee.jpg"<br>
 
   image = "mrlee.jpg"<br>
 
   server = "https://middleware.systems/"<br>
 
   server = "https://middleware.systems/"<br>

Revision as of 17:39, 19 April 2017

The SMaterial class provides a wrapper around Materials used for rendering

Members

SetFloat

void SetFloat (string name, float value);

Sets a shader property to value

No example provided yet

SetColor

void SetColor (string name, float r, float g, float b, float a);

Sets a shader colour to value (HDR variant, 0..1 values)

No example provided yet

SetColor32

void SetColor32 (string name, byte r, byte g, byte b, byte a);

Sets a shader colour to value (32-bit, 0..255 values)

No example provided yet

SetInt

void SetInt (string name, int value);

Sets a shader property to value

No example provided yet

SetTexture

void SetTexture (string name, SResource texture);

Sets a object's specified texture map (specified in parameter 1) to the texture provided as a resource in parameter #2

function hithere()
  image = "mrlee.jpg"
server = "https://middleware.systems/"
obj = Space.Host.GetReference("dispobj")
resrc = Space.WebServices.GetImage(server .. "mrlee.jpg")
obj.Renderer.Material.SetTexture("_MainTex", resrc)
end

SetTextureOffset

void SetTextureOffset (string name, float x, float y);

Sets a texture offset to a value. IF USING FOR SCROLLING ANIMATION PLEASE US A ANIMATION NOT A SCRIPT

No example provided yet

SetTextureScale

void SetTextureScale (string name, float x, float y);

Sets a texture scale to a value. IF USING FOR SCROLLING ANIMATION PLEASE US A ANIMATION NOT A SCRIPT

No example provided yet

SetVector

void SetVector (string name, SVector value);

Sets a shader property to value

No example provided yet