git.s-ol.nu alive / 29c6f00
more extensive love documentation s-ol 4 months ago
2 changed file(s) with 29 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
104104 Constant.meta
105105 meta:
106106 name: 'love'
107 summary: "LÖVE visuals."
107 summary: "LÖVE graphics."
108 description: "
109 This module implements basic graphics using the [love2d game engine][love].
110
111 #### running
112
113 In order to use this module, the copilot has to be started in a specific way:
114
115 $ love bin/alv-love <session.alv>
116
117 #### usage
118
119 The [love/draw][] ops can be used to draw one or more `love/shape`s in a fixed
120 stacking order. `love/shape`s can be created using [love/rectangle][] etc, and
121 positioned and styled using the modifier ops like [love/translate][],
122 [love/color][] and so on. All modifier ops take the shape as the last input and
123 output a modified shape, and can be used comfortably with the thread-last
124 macro [->>][]:
125
126 (import* love math)
127 (draw (->>
128 (rectangle 'fill' 100 100)
129 (color 1 0 0)
130 (rotate (/ pi 4))
131 (translate 150 150)))
132
133
134 [love]: https://love2d.org"
108135
109136 value:
110137 :draw
2929
3030 buf = p m.summary
3131 if m.description
32 buf ..= (compile autoref m.description).body
32 buf ..= (compile autoref(m.description), 'nopants').body
3333
3434 buf
3535