This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials
-- let's create the function which sets the position of displayed text
function setTextPosHook(text)
-- if text owner is a character then...
if text:getLink(VTextOwner):getId().tableId == eCharacters then
text:setValue(VTextPosition, {x=960, y=100})
end
end
-- let's create the event listener for handling position of displayed text
registerHookFunction("setTextPosition", "setTextPosHook")
Create point and click adventures without coding. The free version covers up to 25 scenes per project. For more scenes or to earn money with your game, you need a license.
See the Indie Bundle Try it for free-- example 1: if character is "some character name" ...
-- let's create the function which sets the position of displayed text
function setTextPosHook(text)
-- if text owner is a character then...
if text:getLink(VTextOwner):getId().tableId == eCharacters then
if text:getLink(VTextOwner):getName() == "add character name here" then
text:setValue(VTextPosition, {x=960, y=100})
end
-- etc ...
end
end
-- let's create the event listener for handling position of displayed text
registerHookFunction("setTextPosition", "setTextPosHook")
-- example 2: if character is "some character name" & scene is "some scene" ...
-- let's create the function which sets the position of displayed text
function setTextPosHook(text)
-- if text owner is a character then...
if text:getLink(VTextOwner):getId().tableId == eCharacters then
if text:getLink(VTextOwner):getName() == "add character name here" and game:getLink(VGameCurrentScene):getName() == "add scene name here" then
text:setValue(VTextPosition, {x=960, y=100})
end
-- etc ...
end
end
-- let's create the event listener for handling position of displayed text
registerHookFunction("setTextPosition", "setTextPosHook")
-- example 2: if character is "some character name" & scene is "some scene" ...
-- let's create the function which sets the position of displayed text
function setTextPosHook(text)
-- if text owner is a character then...
if text:getLink(VTextOwner):getId().tableId == eCharacters then
if text:getLink(VTextOwner):getName() == "emo" and game:getLink(VGameCurrentScene):getName() == "emohall" then
text:setValue(VTextPosition, {x=9, y=1})
end
-- etc ...
end
end
-- let's create the event listener for handling position of displayed text
registerHookFunction("setTextPosition", "setTextPosHook")
if
else
elseif
and
or
end
not
etc....
function OnStartText(text)
text:setValue(VTextPosition, {x=9, y=1})
end
--function OnStopText(text)
--end
--function OnMainLoop()
--end
registerEventHandler("textStarted","OnStartText")
--registerEventHandler("textStopped","OnStopText")
--registerEventHandler("mainLoop", "OnMainLoop")
function setTextPosHook(text)
text:setValue(VTextPosition, {x=9, y=1})
end
registerHookFunction("setTextPosition", "setTextPosHook")
function setTextPosHook(text)
if text:getLink(VTextOwner):getId().tableId == eCharacters and text:getLink(VTextOwner):getName() == "name" then
text:setValue(VTextPosition, {x=750, y=330})
return true
end
end
registerHookFunction("setTextPosition", "setTextPosHook")