|
diff --git a/README.md b/README.md
|
| ... |
| 15 |
|
15 |
|
| 16 |
## Documentation |
16 |
## Documentation |
| 17 |
|
17 |
|
|
|
18 |
### Quick example |
|
|
19 |
|
|
|
20 |
```lua |
|
|
21 |
-- mygame.lua |
|
|
22 |
-- bidi -f mygame.lua |
|
|
23 |
|
|
|
24 |
open_window(800, 800, "My Game") |
|
|
25 |
set_fps(60) |
|
|
26 |
|
|
|
27 |
while window_running() do |
|
|
28 |
start_drawing() |
|
|
29 |
clear_window(color.BLACK) |
|
|
30 |
|
|
|
31 |
draw_rect(100, 100, 300, 200, color.YELLOW) |
|
|
32 |
draw_text("Label text", 10, 10, 20, color.VIOLET) |
|
|
33 |
draw_line(400, 10, 500, 100, color.RED) |
|
|
34 |
draw_circle(500, 500, 100, color.BLUE) |
|
|
35 |
draw_ellipse(200, 500, 100, 50, color.BLUE) |
|
|
36 |
draw_triangle(20, 20, 100, 20, 50, 100, color.BLUE) |
|
|
37 |
draw_text(string.format("fps: %d", get_fps()), 10, 30, 20, color.VIOLET) |
|
|
38 |
draw_text(string.format("dt: %.3f", get_dt()), 10, 50, 20, color.VIOLET) |
|
|
39 |
|
|
|
40 |
draw_info() |
|
|
41 |
stop_drawing() |
|
|
42 |
end |
|
|
43 |
|
|
|
44 |
close_window() |
|
|
45 |
``` |
|
|
46 |
|
| 18 |
### Included functions |
47 |
### Included functions |
| 19 |
|
48 |
|
| 20 |
| Function | Arguments | Returns | |
49 |
| Function | Arguments | Returns | |
| ... |
| 45 |
| `load_audio` | `TODO` | | |
74 |
| `load_audio` | `TODO` | | |
| 46 |
| `button_down` | `button button` | `bool` | |
75 |
| `button_down` | `button button` | `bool` | |
| 47 |
| `button_pressed` | `button button` | `bool` | |
76 |
| `button_pressed` | `button button` | `bool` | |
| 48 |
|
|
|
| 49 |
**Short example of function use** |
|
|
| 50 |
|
|
|
| 51 |
```lua |
|
|
| 52 |
draw_rect(100, 100, 300, 200, color.YELLOW) |
|
|
| 53 |
draw_text("Label text", 10, 10, 20, color.VIOLET) |
|
|
| 54 |
draw_line(400, 10, 500, 100, color.RED) |
|
|
| 55 |
draw_circle(500, 500, 100, color.BLUE) |
|
|
| 56 |
draw_ellipse(200, 500, 100, 50, color.BLUE) |
|
|
| 57 |
draw_triangle(20, 20, 100, 20, 50, 100, color.BLUE) |
|
|
| 58 |
draw_text(string.format("fps: %d", get_fps()), 10, 30, 20, color.VIOLET) |
|
|
| 59 |
draw_text(string.format("dt: %.3f", get_dt()), 10, 50, 20, color.VIOLET) |
|
|
| 60 |
``` |
|
|
| 61 |
|
77 |
|
| 62 |
### Controller mappings |
78 |
### Controller mappings |
| 63 |
|
79 |
|
| ... |