update example to latest dev commit
parent
86584d54bb
commit
7cc7088036
36
run.scm
36
run.scm
|
@ -2,10 +2,10 @@
|
|||
(sdl2)
|
||||
(sdl2 ttf)
|
||||
(ice-9 match)
|
||||
(tsukundere button)
|
||||
(tsukundere menu button)
|
||||
(tsukundere game)
|
||||
(tsukundere scene)
|
||||
(tsukundere geometry)
|
||||
(tsukundere math)
|
||||
(tsukundere script utils))
|
||||
|
||||
(define (load)
|
||||
|
@ -22,11 +22,13 @@
|
|||
(simple-hover (load-image "round_button_hover.png"))
|
||||
(simple-pressed (load-image "round_button_mouse_down.png"))
|
||||
(font (load-font "JuliaMono.ttf" 18))
|
||||
(colors `((none . ,(make-color 0 255 0 255))
|
||||
(hover . ,(make-color 255 0 0 255))
|
||||
(pressed . ,(make-color 0 0 255 255))))
|
||||
(textures `((none . ,texture)
|
||||
(pressed . ,selected)))
|
||||
(colors
|
||||
`((none . ,(make-color 80 225 100 255))
|
||||
(hover . ,(make-color 255 0 0 255))
|
||||
(pressed . ,(make-color 0 0 255 255))))
|
||||
(textures
|
||||
`((none . ,texture)
|
||||
(pressed . ,selected)))
|
||||
(textures-radio
|
||||
`((none . ,radio)
|
||||
(pressed . ,radio-selected)))
|
||||
|
@ -37,14 +39,22 @@
|
|||
(checkbox-button
|
||||
(make-button (s32vector 0 0) "" 0 font textures
|
||||
#:text-colors colors
|
||||
#:text-pos (s32vector 30 5)
|
||||
#:text-alignment '(left . top)
|
||||
#:callback checkbox-button-callback))
|
||||
(radio-button
|
||||
(make-button (s32vector 0 0) "" 0 font textures-radio
|
||||
#:text-colors colors
|
||||
#:text-alignment '(left . top)
|
||||
#:text-pos (s32vector 30 0)
|
||||
#:callback radio-button-callback))
|
||||
(simple-button
|
||||
(make-button (s32vector 0 0) "" 0 font textures-button
|
||||
#:text-colors colors
|
||||
;; Put text at the center of the button
|
||||
#:text-pos (s32vector 0 0)
|
||||
#:anchor 'center
|
||||
#:text-alignment '(center . center)
|
||||
#:callback simple-button-callback)))
|
||||
(init-script!
|
||||
(lambda ()
|
||||
|
@ -65,6 +75,10 @@
|
|||
#:template checkbox-button)))
|
||||
(pause)
|
||||
(say "nixo" "Click it!")
|
||||
(say "nixo"
|
||||
(format #f "You selected the element: ~a\n"
|
||||
(menu
|
||||
'((yep "Yes") (maybe "Maybe") (nope "No way")))))
|
||||
(say "nixo"
|
||||
(format #f "You selected the element number: ~a\n"
|
||||
(menu
|
||||
|
@ -77,13 +91,7 @@
|
|||
(format #f "You selected the element: ~a\n"
|
||||
(menu
|
||||
'((yep "Yes") (maybe "Maybe") (nope "No way")))))
|
||||
(pause)
|
||||
;; (format #f "You selected the element with value: ~a\n"
|
||||
;; (menu
|
||||
;; '(("Yes" I am happy now)
|
||||
;; ("Maybe" you have more time to decide)
|
||||
;; ("No way" that makes me sad))))
|
||||
)
|
||||
(pause))
|
||||
scene)
|
||||
(init-menu! 100 100 (s32vector 0 50) font textures
|
||||
(s32vector 50 18)
|
||||
|
|
Loading…
Reference in New Issue