From d84bb24d2359be9c4be7b3e4f05caf3daf68f243 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Mon, 9 Mar 2015 08:52:14 -0400 Subject: render: Merge into . * sly/render/model.scm (): Add 'transform' and 'children' fields. (model-transform, model-children): New accessors. (make-model): Add 'transform' and 'children' keyword arguments. (set-transform-identity!): New procedure. (draw-model): Recursively draw model and all children. (model-paint, model-blend): Renamed. (paint, blend, group, group*, move, place): New procedures. * sly/render/group.scm: Delete. * Makefile.am (SOURCES): Remove it. * examples/2048/2048.scm: Update example. * examples/animation.scm: Likewise. * examples/font.scm: Likewise. * examples/joystick.scm: Likewise. * examples/mines/mines.scm: Likewise. * examples/simple.scm: Likewise. * examples/tilemap.scm: Likewise. * README.org (Example): Update sample code. --- examples/mines/mines.scm | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'examples/mines') diff --git a/examples/mines/mines.scm b/examples/mines/mines.scm index 97d77b0..663e146 100644 --- a/examples/mines/mines.scm +++ b/examples/mines/mines.scm @@ -37,7 +37,6 @@ (sly render camera) (sly render color) (sly render font) - (sly render group) (sly render model) (sly render sprite) (sly input keyboard) @@ -332,24 +331,24 @@ (lambda (tile) ;; A tile may or may not have an overlay, so we do a little ;; quasiquoting magic to build the right list. - (make-group + (group* `(,(tile-base-sprite tile) ,@(let ((overlay (tile-overlay-sprite tile))) (if overlay - (list (group-place offset (group overlay))) + (list (place offset (group overlay))) '()))))))) (define-signal board-view (signal-map (lambda (board) (define (draw-column tile x) - (group-move (vector2 (* x tile-size) 0) - (draw-tile tile))) + (move (vector2 (* x tile-size) 0) + (draw-tile tile))) (define (draw-row row y) - (group-move (vector2 0 (* y tile-size)) - (make-group (enumerate-map draw-column row)))) + (move (vector2 0 (* y tile-size)) + (group* (enumerate-map draw-column row)))) - (make-group (enumerate-map draw-row board))) + (group* (enumerate-map draw-row board))) board)) (define-signal status-message @@ -357,9 +356,9 @@ (define (make-message message) (label font message #:anchor 'center)) - (group-move + (move (vector2 (/ (vx resolution) 2) (- (vy resolution) 64)) - (make-group + (group* (cond ((board-lose? board) (list (make-message "GAME OVER - Press N to play again"))) @@ -372,7 +371,7 @@ (signal-map (lambda (board-view status center-position) (group status - (group-move center-position board-view))) + (move center-position board-view))) board-view status-message center-position)) (define camera @@ -382,7 +381,7 @@ #:clear-color tango-dark-plum))) (define (draw-scene dt alpha) - (draw-group (signal-ref scene) camera)) + (draw-model (signal-ref scene) camera)) ;;; ;;; Initialization -- cgit v1.2.3