This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials
function moveObj(obj, x, y, delay, easing)
obj = getObject("0016dt_on_nav_device.SceneObjects["XY_space_img"]")
startObjectTween(obj, VObjectOffset, obj:getPoint(VObjectOffset), {x = x, y = y}, delay, easing)
end
local curPos = getCursorPos()
moveObj("XY_space_img", curPos.x, curPos.y, 5000, easeQuintOut)
The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license. Until 1 Dec 2026 all licenses are 30 % off, for example the Indie Bundle for €69.30 instead of €99. The code BLACKFRIDAY is applied automatically at checkout.
See licenses Try it for freelocal curPos = getCursorPos()
local obj = getObject('Objects[XY_space_img]')
moveObj(obj, curPos.x, curPos.y, 5000, easeQuintOut)
function moveObj(obj, x, y, delay, easing)
local objPos = obj:getPoint(VObjectPosition)
startObjectTween(obj, VObjectOffset, obj:getPoint(VObjectOffset), {x = x - objPos.x, y = y - objPos.y}, delay, easing)
end
obj = getObject("0016dt_on_nav_device.SceneObjects["XY_space_img"]")
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
moveObj("XY_space_img", getCursorPos().x, getCursorPos().y, 5000, easeQuintOut) -- should work
function moveObj(obj, scn, x, y, delay, easing)
obj = getObject("Scenes[" .. scn .. "].SceneObjects[" .. obj .. "]")
startObjectTween(obj, VObjectOffset, obj:getPoint(VObjectOffset), {x = x, y = y}, delay, easing)
end
moveObj("object_name", "scene_name", 300, 500, 5000, easeQuintOut) -- object & scene names are case sensitive
local t = {}
t[1] = {x = 100, y = 250}
t[2] = {x = 200, y = 500}
---etc...
moveObj("XY_space_img", t[1].x, t[1].y, 5000, easeQuintOut)
I want to move the object to a specific coordinate exact where I do left click with the mouse.You want to move the object to a specific coordinate but not the exact coordinate where the mouse is?
Alex: why does he need to get current position & - whatever from whatever? I tested the workflow function multiple times before adding it to the wiki & it worked as it was supposed to work.
I want to move the object to a specific coordinate exact where I do left click with the mouse.
local img_width = 16 -- 16 being 16 pixels, new getSize() function is not available in current public build...
local img_height = 24
local cPos = getCursorPos()
local t = {x = cPos.x - (img_width / 2), y = cPos.y - (img_height / 2)} -- get offset values
moveObj("XY_space_img", t[1].x, t[1].y, 5000, easeQuintOut)
This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.
New threadDeponia, The Whispered World and more than 160 other games were made with Visionaire Studio. The free version covers up to 25 scenes. For more scenes there is Visionaire Studio PRO from €75, and to sell your game the Indie Bundle for €99.
Through December 1: all licenses 30% off, for example the Indie Bundle for €69.30 instead of €99. Applied automatically at checkout.