lovr/README.md

44 lines
760 B
Markdown
Raw Normal View History

2016-07-10 23:25:40 +00:00
LÖVR
2016-08-01 00:47:28 +00:00
===
2016-07-10 23:25:40 +00:00
2016-09-30 07:17:35 +00:00
LÖVR lets you make VR games with Lua!
2016-08-01 00:47:28 +00:00
Example
---
2016-09-30 07:17:35 +00:00
In a folder called `myGame`, create a file called `main.lua` with this in it:
2016-08-01 00:47:28 +00:00
2016-08-01 00:48:08 +00:00
```lua
2016-08-01 00:47:28 +00:00
function lovr.update(dt)
2016-09-30 07:17:35 +00:00
t = (t or 0) + dt
2016-08-01 00:47:28 +00:00
end
2016-09-30 07:17:35 +00:00
function lovr.draw(eye)
2016-10-03 01:13:58 +00:00
local x, y, z = 0, .25, -2
local size = 1
local angle, rx, ry, rz = t * 2, 0, 1, 0
2016-08-01 00:47:28 +00:00
2016-10-03 01:13:58 +00:00
lovr.graphics.setColor(128, 0, 255)
lovr.graphics.cube('line', x, y, z, size, angle, rx, ry, rz)
end
2016-08-01 00:47:28 +00:00
```
2016-10-04 22:01:29 +00:00
Drag the `myGame` folder onto a shortcut to `lovr.exe`. You should see a spinning purple cube!
2016-09-30 07:17:35 +00:00
2016-10-04 19:10:25 +00:00
Documentation
2016-08-01 00:47:28 +00:00
---
2016-10-04 22:01:29 +00:00
Some basic reference documentation exists in [`API.md`](doc/API.md).
2016-08-01 00:47:28 +00:00
2016-09-18 01:18:16 +00:00
Supported Hardware
---
- HTC Vive
2016-09-30 07:17:35 +00:00
Support for other hardware will happen eventually.
2016-08-10 06:42:30 +00:00
Compiling
2016-08-01 00:47:28 +00:00
---
2016-10-04 22:01:29 +00:00
See the [compilation guide](doc/COMPILING.md).