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)
local 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)