commit 1875b8759296bc7c5133df90cd5128d4a723f58c
parent 69753c23457424aa249c6d07a344bef260cfd18e
Author: Daniel Barlow <dan@telent.net>
Date: Fri, 1 Jul 2022 22:08:15 +0000
use output width/height instead of hardcoding
Diffstat:
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/rc.fnl b/rc.fnl
@@ -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 []