diff options
Diffstat (limited to 'scenes/intro.scm')
-rw-r--r-- | scenes/intro.scm | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/scenes/intro.scm b/scenes/intro.scm index cc6c5a0..4fb4b69 100644 --- a/scenes/intro.scm +++ b/scenes/intro.scm @@ -19,7 +19,10 @@ #:use-module (chickadee audio) #:use-module (chickadee math rect) #:use-module (chickadee math vector) + #:use-module (chickadee render color) #:use-module (chickadee render font) + #:use-module (chickadee render texture) + #:use-module (chickadee scripting) #:use-module (engine assets) #:use-module (engine node) #:use-module (engine node-2d) @@ -93,4 +96,23 @@ to dry.")) (define (intro) (set-music-volume! 1.0) (play-music (load-music "assets/music/intro.ogg") #:loop? #f) - (make <intro>)) + (let ((container (make <node-2d> + #:children + (list + (make <sprite> + #:name 'bg + #:texture (load-image "assets/images/intro-bg.png")) + (make <intro>) + (make <filled-rect> + #:name 'fade-all + #:region (make-rect 0.0 0.0 %width %height) + #:color (make-color 1 1 1 1.0)))))) + ;; Fade in + (with-agenda + (agenda container) + (script + (tween 240 1.0 0.0 + (lambda (alpha) + (set! (color (child-ref container 'fade-all)) + (make-color 1 1 1 alpha)))))) + container)) |