Currently, text when my character is speaking is set with the function setTextPosHook
code :
local txtP = getObject("Conditions[invopen]")
function setTextPosHook(text)
if text:getLink(VTextOwner):getId().tableId == eCharacters and text:getLink(VTextOwner):getName() == "Ben" then
if txtP:getBool(VConditionValue) == true then
text:setValue(VTextPosition, {x= game:getPoint(VGameWindowResolution).x/2, y= 700})
else
text:setValue(VTextPosition, {x= game:getPoint(VGameWindowResolution).x/2, y= 850})
end
end
return true
end
registerHookFunction("setTextPosition", "setTextPosHook")
But I will like this (script for VS5):
That the text is placed each time above the character who speaks (as in deponia), so follow the movement of my character, and if the character is too far right or too much left, that the text is not truncated
I am looking for several hours in lua but I can not find the solution.
Thank you for your help