Difference between revisions of "ShaderColorize (CMS)"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "<div class="toccolours mw-collapsible mw-collapsed tbl-ds"> <span class="bold">Function History</span> <div class="mw-collapsible-content"> <div class="alt-bg">Available since...")
 
m
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div class="toccolours mw-collapsible mw-collapsed tbl-ds">
+
{| class="ts" style="width:100%"
<span class="bold">Function History</span>
+
|-
<div class="mw-collapsible-content">
+
! style="text-align:left" | Name !! style="text-align:left" | Type
<div class="alt-bg">Available since v4.0</div>
+
|-
</div></div>
+
| shaderColorize(hue, strength, delay) || Execution
 
+
|}
 
 
Allows the user to colorize the screen over a specified amount of time. ''The [[Shader_(CMS)|shader toolkit]] is needed for this function to work''.
 
<div class="toccolours mw-collapsible mw-collapsed tbl-ds">
 
<span class="bold">Additional Info</span>
 
<div class="mw-collapsible-content">
 
<div class="alt-bg">I don't think this function is currently working correctly as it should fade from current hue to specified hue & instead it cycles through hue values like a rainbow.</div>
 
</div></div>
 
  
  
Syntax:
+
Allows the user to colorize the screen over a specified amount of time. ''The [[Shader_(CMS)|shader toolkit]] is required for this function to work''.
<syntaxhighlight>
 
shaderColorize(hue, strength, delay)
 
</syntaxhighlight>
 
  
  
Example 1: set colorize amount  
+
== Examples ==
 +
=== Enable ===
 +
Set colorize amount  
 
<syntaxhighlight>
 
<syntaxhighlight>
 
shaderColorize(0, 1, 3000) -- colorize screen red over 3000 milliseconds
 
shaderColorize(0, 1, 3000) -- colorize screen red over 3000 milliseconds
 
shaderColorize(0, 1, 0) -- colorize screen red instantly
 
shaderColorize(0, 1, 0) -- colorize screen red instantly
 
</syntaxhighlight>
 
</syntaxhighlight>
 
+
=== Disable ===
 
+
Turn colorize off  
Example 2: turn colorize off  
 
 
<syntaxhighlight>
 
<syntaxhighlight>
 
shaderColorize(0, 0, 3000) -- restore colorize value back to default over 3000 milliseconds
 
shaderColorize(0, 0, 3000) -- restore colorize value back to default over 3000 milliseconds
Line 34: Line 25:
  
  
 +
== Syntax Breakdown ==
 +
{| class="ts" style="width:100%"
 +
|-
 +
! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left;width:80%" | Description
 +
|-
 +
| hue || float (decimal) || Define the hue target; number between 0 & 1 (red > yellow > green > blue > pink > red).
 +
|-
 +
| strength || float (decimal) || The amount to colorize the screen by; recommended value between 0 & 1 (possible to go over 1, but might generate strange artifacts).
 +
|-
 +
| delay || integer (number) || The amount of time to colorize the screen over; in milliseconds (ms).
 +
|}
  
<span class="bold underline">Arguments</span>
 
  
'''hue''': float (number) <br/>
+
== Resources ==
Define the hue target; number between 0 & 1 (red > yellow > green > blue > pink > red)
+
{| class="ts"
 
+
|-
'''strength''': float (number)<br/>
+
! style="text-align:left" | Name !! style="text-align:left" | Description
The amount to colorize the screen by; recommended value between 0 & 1 (possible to go over 1, but might generate strange artifacts)
 
 
 
'''delay''': integer (number)<br/>
 
The amount of time to colorize the screen over in milliseconds (ms)
 
 
 
 
 
 
 
<span class="bold underline">Flags</span>
 
 
 
none
 
 
 
 
 
 
 
<span class="bold underline">Return</span>
 
 
 
none
 
 
 
 
 
 
 
{| class="tbl-ds"
 
 
|-
 
|-
|<span class="bold">Relevant Pages</span>: to add...
+
| [[media:shaderColorize.zip|shaderColorize.zip]] || A working .ved file, complete with resources. Check out the readme.txt file for instructions.
|}
+
|}{{toc}}

Latest revision as of 21:28, 7 November 2014

Name Type
shaderColorize(hue, strength, delay) Execution


Allows the user to colorize the screen over a specified amount of time. The shader toolkit is required for this function to work.


Examples

Enable

Set colorize amount

shaderColorize(0, 1, 3000) -- colorize screen red over 3000 milliseconds
shaderColorize(0, 1, 0) -- colorize screen red instantly

Disable

Turn colorize off

shaderColorize(0, 0, 3000) -- restore colorize value back to default over 3000 milliseconds
shaderColorize(0, 0, 0) -- restore colorize value back to default instantly


Syntax Breakdown

Name Type Description
hue float (decimal) Define the hue target; number between 0 & 1 (red > yellow > green > blue > pink > red).
strength float (decimal) The amount to colorize the screen by; recommended value between 0 & 1 (possible to go over 1, but might generate strange artifacts).
delay integer (number) The amount of time to colorize the screen over; in milliseconds (ms).


Resources

Name Description
shaderColorize.zip A working .ved file, complete with resources. Check out the readme.txt file for instructions.