local offset = 34 -- offset from bottom (in pixels)
local x = (game.WindowResolution.x / 2) -- calculate center value of resolution width
local y = (game.WindowResolution.y - offset) -- calculate offset of text from bottom
-- * function which updates the text position of displayed texts (character & narration) * --
function txtPos(text)
if not game.CurrentScene.SceneIsMenu then -- if scene is not a menu then...
text:setValue(VTextPosition, {x = game.ScrollPosition.x + x, y = game.ScrollPosition.y + y}) -- define the new text position
return true -- update text position
end
return false -- else don't update text position
end
registerHookFunction("setTextPosition", "txtPos") -- define the hook function for handling text position