From dbc822ba1961b67a66e3f9219e47f9fbcc112789 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sat, 17 Apr 2021 16:51:23 -0400 Subject: Add basic text box. --- game.scm | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/game.scm b/game.scm index baaaa00..b5f1aed 100644 --- a/game.scm +++ b/game.scm @@ -1,4 +1,7 @@ -(use-modules (chickadee graphics texture) +(use-modules (chickadee graphics color) + (chickadee graphics font) + (chickadee graphics texture) + (chickadee graphics viewport) (chickadee math vector) (oop goops) (starling asset) @@ -8,17 +11,78 @@ (starling node-2d) (starling scene)) + +;;; +;;; Constants +;;; + (define window-width 1280) (define window-height 720) (define game-width 640) (define game-height 360) -(define-class ()) + +;;; +;;; Assets +;;; + +(define-asset dialog-box-texture (load-image "assets/images/dialog-box.png")) +(define-asset darkness (load-image "assets/images/darkness.png")) +(define-asset room-background (load-image "assets/images/room.png")) +(define-asset monogram-font (load-font "assets/fonts/monogram_extended.ttf" 12)) + + +;;; +;;; Text Box +;;; + +(define-class () + (text #:accessor text #:init-keyword #:text #:init-value "" #:watch? #t)) + +(define-method (apply-theme (text-box )) + (next-method) + (replace text-box + (make