function dialog(co, name, textPages)
    local namedPages = {}
    for i, text in ipairs(textPages) do
        namedPages[i] = "[" .. name .. "] " .. text
    end
    dialogBox(namedPages, {}, -1)
    while isDialogExecuted() do
        co.yield()
    end
end

function choices(co, choicePages)
    dialogBox({}, choicePages, 0)
    while isDialogExecuted() do
        co.yield()
    end
end

center = {
    x = getScreenWidth()/2,
    y = getScreenHeight()/2
}

right = {
    x = getScreenWidth()-getScreenWidth()/3,
    y = getScreenHeight()/2
}

left = {
    x = getScreenWidth()/3,
    y = getScreenHeight()/2
}

function EventLoopCoroutine()
    dialogCoroutine = coroutine.create(function()
        dialog(dialogCoroutine, "test", {test})
    end)
end

function EventLoop()
    if dialogCoroutine and coroutine.status(dialogCoroutine) ~= "dead" then
        coroutine.resume(dialogCoroutine)
    end
end

setFont("res/InterTight-Regular.ttf")
EventLoopCoroutine()