Difference between revisions of "ShaderBlur (CMS)"

From The Official Visionaire Studio: Adventure Game Engine Wiki
m
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 !! style="text-align:left" | By
<div class="alt-bg">Available since v4.0</div>
+
|-
</div></div>
+
| shaderBlur(value, delay) || Execution
 +
|}
  
  
 
Allows the user to blur or focus the camera/screen over a specified amount of time. ''The [[Shader_(CMS)|shader toolkit]] is needed for this function to work''.
 
Allows the user to blur or focus the camera/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">Any values below 0.8 and above 2 tend to have some trippy side effects. Recommended values are between 0.8 & 1.4.</div>
 
</div></div>
 
 
 
Syntax:
 
<syntaxhighlight>
 
shaderBlur(active, value, delay)
 
</syntaxhighlight>
 
  
  
 +
== Examples ==
 
Example 1: set blur amount
 
Example 1: set blur amount
 
<syntaxhighlight>
 
<syntaxhighlight>
shaderBlur(1, 0.8, 3000) -- blur the screen over 3000 milliseconds
+
shaderBlur(0.8, 3000) -- blur the screen by .8 over 3 seconds
shaderBlur(1, 0.8, 0) -- blur screen instantly
+
shaderBlur(0.8, 0) -- blur the screen by .8 instantly
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 29: Line 20:
 
Example 2: turn blur off
 
Example 2: turn blur off
 
<syntaxhighlight>
 
<syntaxhighlight>
shaderBlur(0, 0, 3000) -- focus screen back to default over 3000 milliseconds
+
shaderBlur(0, 3000) -- focus screen back to default over 3 seconds
shaderBlur(0, 0, 0) -- focus screen back to default instantly
+
shaderBlur(0, 0) -- focus screen back to default instantly
 
</syntaxhighlight>
 
</syntaxhighlight>
  
  
 
+
== Syntax Breakdown ==
<span class="bold underline">Arguments</span>
+
{| class="ts" style="width:100%"
 
+
|-
'''active''': integer (number)<br/>
+
! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left;width:80%" | Description
Render blur active or inactive; 0 = off, 1 = on
+
|-
 
+
| value || float (decimal) || The amount to blur the screen by; recommended value somewhere between 0 & 20.
'''value''': float (number)<br/>
 
The amount to blur the screen by; recommended value somewhere between 0.8 & 1.4
 
 
 
'''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...
+
| delay || integer (number) || The amount of time to blur/focus the screen over; in milliseconds (ms).
 
|}
 
|}

Revision as of 14:34, 30 September 2014

Name Type By
shaderBlur(value, delay) Execution


Allows the user to blur or focus the camera/screen over a specified amount of time. The shader toolkit is needed for this function to work.


Examples

Example 1: set blur amount

shaderBlur(0.8, 3000) -- blur the screen by .8 over 3 seconds
shaderBlur(0.8, 0) -- blur the screen by .8 instantly


Example 2: turn blur off

shaderBlur(0, 3000) -- focus screen back to default over 3 seconds
shaderBlur(0, 0) -- focus screen back to default instantly


Syntax Breakdown

Name Type Description
value float (decimal) The amount to blur the screen by; recommended value somewhere between 0 & 20.
delay integer (number) The amount of time to blur/focus the screen over; in milliseconds (ms).