Files
wschod/game/res/scripts/u_debug.scm
T
2025-07-22 20:21:38 +02:00

26 lines
997 B
Scheme

;; The function is evaulated and returns a pointer, the game eats it
;; and adds it to the UI root. Boom.
(widget-new
'plain
(widget-new
'window
#:style style-window
#:text "Debug window"
#:w 350
#:layout-padding 8
#:vertical #f
#:horizontal #t
;; The rest is children.
(widget-new
'flowbox
#:style style-container
#:layout-padding 8
#:layout-spacing 8
#:horizontal #t
(widget-label-gvar 'float "Delta time: ~,2f" "delta_time" #:style style-default #:layout-weight 1 #:h 20 #:text-alignment 'center)
(widget-label-gvar 'int "~d chunks" "frame_chunks" #:style style-default #:layout-weight 0.5 #:h 20)
(widget-label-gvar 'int "~d entities" "frame_entities" #:style style-default #:layout-weight 0.5 #:h 20)
(widget-checkbox "Flight" "flight_enabled" #:layout-weight 0.5 #:h 20)
(widget-checkbox "Wireframe" "wireframe_enabled" #:layout-weight 0.5 #:h 20)
(widget-spinner 'int "Render distance: ~d" "render_distance" #:layout-weight 1 #:h 20))))