
function init_event()
    ag.import("std")
    image = ag.loadTexture("transparent.png")
    local crate = ag.loadModel("crate", {static = true})
    ag.setCamera(5, -5, 5)
    local box = ag.createBox(1, 1, 1, {enable_blending = true})
    box:setPosition(0, 0, 3)
    box:setTexture(image)
end

function update_overlay_event(width, height)
    local time = ag.elapsedTime()
    local rot = time / 1000 * 90
    local scale = math.sin(time / 1000) * 1.5 / 2 + 1.25
    ag.drawImage(256 * scale, 256 * scale, width / 2, height / 2, image, rot);
    ag.drawArc(1, 0, 0.5, width * 0.8, height * 0.8, height * 0.15,
        90, 180);
    ag.drawCircle(0, 0, 1, width * 0.8, height * 0.2, height * 0.15);
end
