From d0250dcd5ebe6de0bb7236b2805869ccd4d45537 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 15 Oct 2021 14:39:53 -0400 Subject: Rename to and to . --- examples/tetra/tetra.scm | 14 +++++------ starling/kernel.scm | 13 +++++----- starling/minibuffer.scm | 2 +- starling/node-2d.scm | 64 ++++++++++++++++++++++++------------------------ starling/repl.scm | 2 +- starling/transition.scm | 8 +++--- 6 files changed, 52 insertions(+), 51 deletions(-) diff --git a/examples/tetra/tetra.scm b/examples/tetra/tetra.scm index f8a10d3..65e5a33 100644 --- a/examples/tetra/tetra.scm +++ b/examples/tetra/tetra.scm @@ -237,7 +237,7 @@ area next to the board." (if init? (teleport piece px py) (run-script piece - (move-to piece px py 8))))) + (move-to piece px py 0.1))))) (define-method (move-piece (piece ) new-x new-y) (move-piece piece new-x new-y #f)) @@ -289,7 +289,7 @@ area next to the board." (define-method (on-clear (row ) particles) (run-script row - (scale-to row 0.0 0.0 10) + (scale-to row 0.0 0.0 0.25) (detach row)) ;; Emit some particles! woooooo (let* ((pos (position row)) @@ -330,7 +330,7 @@ area next to the board." (define-method (on-boot (board )) (set! (batch board) (make-sprite-batch #f)) (attach-to board - (make + (make #:name 'background #:painter (with-style ((fill-color tango-aluminium-6)) (fill @@ -425,7 +425,7 @@ area next to the board." (define-method (remove-filled-rows (board )) (let* ((rows (rows board)) (rows-to-remove (filled-rows board)) - (anim-duration 10)) + (anim-duration 0.25)) (let loop ((dead-rows rows-to-remove) (count 0)) (match dead-rows @@ -517,7 +517,7 @@ area next to the board." (/ container-width 2.0)) (/ (- window-height container-height) 2.0))))) (attach-to container - (make + (make #:name 'background #:painter (with-style ((fill-color tango-aluminium-6) (stroke-color tango-aluminium-3) @@ -571,7 +571,7 @@ area next to the board." (define-method (on-boot (tetra )) (set! (board tetra) (make )) (attach-to tetra - (make + (make #:painter (with-style ((fill-color tango-aluminium-5)) (fill (rectangle (vec2 0.0 0.0) window-width window-height)))) @@ -582,7 +582,7 @@ area next to the board." #:font click-font #:position (vec2 (centered-text text) 630.0) #:scale (vec2 2.0 2.0))) - (make + (make #:name 'next-background #:painter (with-style ((fill-color tango-aluminium-6)) (fill diff --git a/starling/kernel.scm b/starling/kernel.scm index 1aed4f3..42107b7 100644 --- a/starling/kernel.scm +++ b/starling/kernel.scm @@ -79,7 +79,7 @@ (define-class ()) (define-method (on-boot (fps-display )) - (let* ((canvas (make #:name 'canvas)) + (let* ((display (make #:name 'display)) (font (default-font)) (padding 4.0) (box-width (+ (font-line-width font "60.0") @@ -87,8 +87,8 @@ (box-height (+ (font-line-height font) (* padding 2.0)))) (call-with-values current-window-size (lambda (window-width window-height) - (attach-to canvas - (make + (attach-to display + (make #:painter (with-style ((fill-color (make-color 0 0 0 0.5))) (fill (rectangle (vec2 0.0 @@ -103,10 +103,10 @@ #:position (vec2 padding (+ (- window-height box-height) padding)))))) - (attach-to fps-display canvas))) + (attach-to fps-display display))) (define-method (update-fps (fps-display ) fps) - (set! (text (& fps-display canvas fps-label)) + (set! (text (& fps-display display fps-label)) (format #f "~1,1f" fps))) @@ -367,7 +367,8 @@ (current-window (window kernel))) (activate kernel) (push-scene kernel (thunk)) - (run-game* #:update (lambda (dt) (update-tree kernel dt)) + (run-game* #:init (const #t) + #:update (lambda (dt) (update-tree kernel dt)) #:render (lambda (alpha) (render-tree kernel alpha)) #:error (lambda (stack key args) (on-error kernel stack key args)) diff --git a/starling/minibuffer.scm b/starling/minibuffer.scm index 9488530..b5b0d42 100644 --- a/starling/minibuffer.scm +++ b/starling/minibuffer.scm @@ -97,7 +97,7 @@ (line-height (font-line-height font)) (padding 8.0)) (attach-to minibuffer - (make + (make #:painter (with-style ((fill-color (make-color 0 0 0 0.7))) (fill (rectangle (vec2 0.0 0.0) diff --git a/starling/node-2d.scm b/starling/node-2d.scm index 71f43bf..257970e 100644 --- a/starling/node-2d.scm +++ b/starling/node-2d.scm @@ -55,7 +55,7 @@ point-within-camera-viewport? window-space->camera-space - + cameras first-camera @@ -122,7 +122,7 @@ batch - + painter