use output width/height instead of hardcoding

main
Daniel Barlow 2022-07-01 22:08:15 +00:00
parent 69753c2345
commit 1875b87592
1 changed files with 8 additions and 7 deletions

15
rc.fnl
View File

@ -18,30 +18,31 @@
"output"
(fn [output]
(output:set_mode 360 720 0)
(let [r (output:renderer)
(let [[width height] (output:size)
r (output:renderer)
kill (texture.from-file r "close-window.png")
launch (texture.from-file r "launcher.png")
spinner (texture.from-file r "carousel.png")]
(output:on "render"
(fn [{: output : renderer}]
(let [bar-height 40]
(let [bar-height (/ height 15)]
(renderer:draw_rect :#00000077
0 (- 720 bar-height)
690 360 bar-height)
0 (- height bar-height)
width bar-height)
(renderer:draw_texture
kill
matrix.identity
30 (- 720 bar-height)
30 (- height bar-height)
0.7)
(renderer:draw_texture
launch
matrix.identity
(- 180 (/ bar-height 2)) (- 720 bar-height)
(- (/ width 2) (/ bar-height 2)) (- height bar-height)
0.7)
(renderer:draw_texture
spinner
matrix.identity
(- 360 30 bar-height) (- 720 bar-height)
(- width 30 bar-height) (- height bar-height)
0.7)))))))
(fn kill-window []