summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2022-07-31 12:42:52 -0400
committerDavid Thompson <dthompson2@worcester.edu>2022-07-31 12:42:52 -0400
commitb75edd152f20a5a8ff88149e7cd2b182040b27f6 (patch)
tree194a4eb64211a2aa91402a84cee4e3772cd1821a
parentdb3a517ff1dc820abc160be7cae39c18fc7564f1 (diff)
node-2d: Add resize method.
-rw-r--r--starling/node-2d.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/starling/node-2d.scm b/starling/node-2d.scm
index 8c48966..b46b454 100644
--- a/starling/node-2d.scm
+++ b/starling/node-2d.scm
@@ -84,6 +84,7 @@
bounding-box
on-child-resize
dirty!
+ resize
move-by
move-to
teleport
@@ -476,6 +477,10 @@
(on-child-resize (parent node) node)))
(set! (dirty-bounding-box? node) #t))))
+(define-method (resize (node <node-2d>) w h)
+ (set! (width node) w)
+ (set! (height node) h))
+
;; Animation helpers
(define-method (move-to (node <node-2d>) x y)