1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-08 23:23:38 +00:00
lovr/examples/bounds/main.lua
2016-12-05 01:16:24 -08:00

21 lines
456 B
Lua

-- Draws a rectangle on the floor, coloring it red
-- when the player is close to the virtual boundary.
function lovr.load()
if not lovr.headset.isPresent() then
error('This example needs a headset')
end
bounds = lovr.graphics.newBuffer(lovr.headset.getBounds())
end
function lovr.draw()
if lovr.headset.isBoundsVisible() then
lovr.graphics.setColor(255, 0, 0)
else
lovr.graphics.setColor(255, 255, 255)
end
bounds:draw()
end