Difference between revisions of "MoveObj (CMS)"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Syntax Breakdown)
m (Text replacement - "wikitable" to "ts")
Line 1: Line 1:
{| class="wikitable" style="width:100%"
+
{| class="ts" style="width:100%"
 
|-
 
|-
 
! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left" | By
 
! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left" | By
Line 24: Line 24:
  
 
== Syntax Breakdown ==
 
== Syntax Breakdown ==
{| class="wikitable" style="width:100%"
+
{| class="ts" style="width:100%"
 
|-
 
|-
 
! 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

Revision as of 19:22, 19 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.