Difference between revisions of "MoveObj (CMS)"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "{| class="wikitable" style="width:100%" |- ! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left" | By |- | moveObj("obj", x, y, delay, ...")
 
(Syntax Breakdown)
Line 28: Line 28:
 
! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left;width:80%" | Description
 
! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left;width:80%" | Description
 
|-
 
|-
| c || "string" || This should be a "string" value containing the name of the character you want to affect; if string is empty it will default to current character.
+
| obj || "string" || This should be a "string" value containing the name of the object you want to affect.
 
|-
 
|-
| t || "string" || This should be a "string" value containing the name of the object you want to align to.
+
| x || integer (number) || This should be a an integer value of the x coordinate you want to move the object to.
 +
|-
 +
| y || integer (number) || This should be a an integer value of the y coordinate you want to move the object to.
 +
|-
 +
| delay || integer (number) || This should be a an integer value of the amount of time (milliseconds) it should take the object to get from a to b.
 +
|-
 +
| easing || integer (number) || This should contain the integer value or name of the easing you want to set.
 
|}
 
|}

Revision as of 15:27, 15 August 2014

Name Type By
moveObj("obj", x, y, delay, easing) Definition AFRLme

This small function allows you to move an object from one position to another over x amount of time with specified easing.

Instructions

1. Add the main script to the Visionaire Studio Script Editor & set the script as a definition script.
2. To use this function you should create an execute a script action containing...

moveObj("object_name", 300, 450, 5000, easeQuintOut) -- move object_name to 350x450 over 5000 milliseconds with easeQuintOut

Main Script

function moveObj(obj, x, y, delay, easing)
 obj = getObject("Game.GameCurrentScene.SceneObjects[" .. obj .. "]")
 startObjectTween(obj, VObjectOffset, obj:getPoint(VObjectOffset), {x = x, y = y}, delay, easing)
end

Syntax Breakdown

Name Type Description
obj "string" This should be a "string" value containing the name of the object you want to affect.
x integer (number) This should be a an integer value of the x coordinate you want to move the object to.
y integer (number) This should be a an integer value of the y coordinate you want to move the object to.
delay integer (number) This should be a an integer value of the amount of time (milliseconds) it should take the object to get from a to b.
easing integer (number) This should contain the integer value or name of the easing you want to set.