aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md42
1 files changed, 29 insertions, 13 deletions
diff --git a/README.md b/README.md
index 185bc1e..0977bf0 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,35 @@ sounds.
15 15
16## Documentation 16## Documentation
17 17
18### Quick example
19
20```lua
21-- mygame.lua
22-- bidi -f mygame.lua
23
24open_window(800, 800, "My Game")
25set_fps(60)
26
27while 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()
42end
43
44close_window()
45```
46
18### Included functions 47### Included functions
19 48
20| Function | Arguments | Returns | 49| Function | Arguments | Returns |
@@ -46,19 +75,6 @@ sounds.
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 77
49**Short example of function use**
50
51```lua
52draw_rect(100, 100, 300, 200, color.YELLOW)
53draw_text("Label text", 10, 10, 20, color.VIOLET)
54draw_line(400, 10, 500, 100, color.RED)
55draw_circle(500, 500, 100, color.BLUE)
56draw_ellipse(200, 500, 100, 50, color.BLUE)
57draw_triangle(20, 20, 100, 20, 50, 100, color.BLUE)
58draw_text(string.format("fps: %d", get_fps()), 10, 30, 20, color.VIOLET)
59draw_text(string.format("dt: %.3f", get_dt()), 10, 50, 20, color.VIOLET)
60```
61
62### Controller mappings 78### Controller mappings
63 79
64| Button | Keyboard | Xbox | Playstation | Nintendo | 80| Button | Keyboard | Xbox | Playstation | Nintendo |