MoveObj (CMS)

From The Official Visionaire Studio: Adventure Game Engine Wiki
Revision as of 15:20, 15 August 2014 by AFRLme (talk) (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, ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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
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.
t "string" This should be a "string" value containing the name of the object you want to align to.