wiki.sine.space | sinespace

Difference between revisions of "Scripting/SMaterial"

From wiki.sine.space
Jump to: navigation, search
(Members)
(Replaced content with "This page has moved to: https://docs.sine.space/v/scripting/client-scripting/types/smaterial")
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The SMaterial class provides a wrapper around Materials used for rendering
+
This page has moved to: https://docs.sine.space/v/scripting/client-scripting/types/smaterial
 
+
==Members==
+
{{ScriptFunction|void|SetFloat|(string name, float value);|Sets a shader property to value}}
+
{{ScriptFunction|void|SetColor|(string name, float r, float g, float b, float a);|Sets a shader colour to value (HDR variant, 0..1 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|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. The example script must be in a object with a '_MainTex' map, and that object should be set as a resource on the scripting runtime. Additionally, that object should be called 'dispobj'.<br><br>note also that this function can be used to set any of the texture maps by varying the value of the first parameter accordingly.|5 = function hithere()<br>
+
  image = "mrlee.jpg"<br>
+
  server = "https://middleware.systems/"<br>
+
  obj = Space.Host.GetReference("dispobj")<br>
+
  resrc = Space.WebServices.GetImage(server .. image)<br>
+
  obj.Renderer.Material.SetTexture("_MainTex", resrc)<br>
+
end<br>
+
}}
+
{{ScriptFunction|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'''}}
+
{{ScriptFunction|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'''}}
+
{{ScriptFunction|void|SetVector|(string name, SVector value);|Sets a shader property to value}}
+
 
+
{{Scripting Navbox}}
+

Latest revision as of 08:02, 19 September 2022

This page has moved to: https://docs.sine.space/v/scripting/client-scripting/types/smaterial