Difference between revisions of "ShaderFollowCharacter (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
 
(4 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>
+
| shaderFollowCharacter(character, zoom, delay) || Execution
 +
|}
  
Smoothly follow a specific camera around the screen. ''The [[Shader_(CMS)|shader toolkit]] is needed for this function to work''.
 
  
 +
Smoothly follow the specified character around the screen. ''The [[Shader_(CMS)|shader toolkit]] is needed for this function to work''.
  
Syntax:
 
<syntaxhighlight>
 
shaderFollowCharacter(character, zoom, delay)
 
</syntaxhighlight>
 
  
 
+
== Examples ==
Example 1: follow current character around the screen
+
=== Enable ===
 +
Follow current character around the screen
 
<syntaxhighlight>
 
<syntaxhighlight>
 
shaderFollowCharacter("", 1.2, 3000) -- follow current character at 1.2x zoom over 3s per movement.
 
shaderFollowCharacter("", 1.2, 3000) -- follow current character at 1.2x zoom over 3s per movement.
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Example 2: follow a specific character around the screen
+
Follow a specific character around the screen
 
<syntaxhighlight>
 
<syntaxhighlight>
 
shaderFollowCharacter("character_name", 1.2, 3000) -- follow character_name at 1.2x zoom over 3s per movement.
 
shaderFollowCharacter("character_name", 1.2, 3000) -- follow character_name at 1.2x zoom over 3s per movement.
 
</syntaxhighlight>
 
</syntaxhighlight>
 
+
=== Disable ===
Example 3: stop following camera & restore screen viewport back to default value
+
Stop following character & restore screen viewport back to default value
 
<syntaxhighlight>
 
<syntaxhighlight>
 
shaderStopFollow(easeQuintOut) -- stop following camera & ease back to viewport default with QuintOut
 
shaderStopFollow(easeQuintOut) -- stop following camera & ease back to viewport default with QuintOut
Line 30: Line 28:
  
  
 
+
== Syntax Breakdown ==
<span class="bold underline">Arguments</span>
+
{| class="ts" style="width:100%"
 
+
|-
'''character''': "string" <br/>
+
! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left;width:80%" | Description
This should be the name of the character you want to follow; if string is empty then it will automatically follow the current character.
+
|-
 
+
| character || "string" || This should be the name of the character you want to follow; if string is empty then it will automatically follow the current character.
'''zoom''': float (number) <br/>
+
|-
This should contain the zoom amount. (''1 = default'')
+
| zoom || float (decimal) || This should contain the zoom amount. (''1 = default'')
 
 
'''delay''': integer (number)<br/>
 
The amount of time (milliseconds) needed to scroll &/or zoom the camera to the current characters location.
 
 
 
 
 
<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 (in milliseconds) needed to scroll &/or zoom the camera to the current characters location.
|}
+
|}{{toc}}

Latest revision as of 14:49, 19 May 2015

Name Type
shaderFollowCharacter(character, zoom, delay) Execution


Smoothly follow the specified character around the screen. The shader toolkit is needed for this function to work.


Examples

Enable

Follow current character around the screen

shaderFollowCharacter("", 1.2, 3000) -- follow current character at 1.2x zoom over 3s per movement.

Follow a specific character around the screen

shaderFollowCharacter("character_name", 1.2, 3000) -- follow character_name at 1.2x zoom over 3s per movement.

Disable

Stop following character & restore screen viewport back to default value

shaderStopFollow(easeQuintOut) -- stop following camera & ease back to viewport default with QuintOut


Syntax Breakdown

Name Type Description
character "string" This should be the name of the character you want to follow; if string is empty then it will automatically follow the current character.
zoom float (decimal) This should contain the zoom amount. (1 = default)
delay integer (number) The amount of time (in milliseconds) needed to scroll &/or zoom the camera to the current characters location.