summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@vistahigherlearning.com>2020-12-16 20:18:54 -0500
committerDavid Thompson <dthompson@vistahigherlearning.com>2020-12-16 20:18:54 -0500
commit7935d911cfbdac775cc307973907091a3d7d1cf9 (patch)
tree9bffec7e7679c05cf03f1a2e3883de76d4ef685a
parent8c68d7c8aeae76231ffdd35a0dfcc8150e82c1b2 (diff)
node-2d: Add first-camera convenience method.
-rw-r--r--starling/node-2d.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/starling/node-2d.scm b/starling/node-2d.scm
index 9a18284..cdf8af1 100644
--- a/starling/node-2d.scm
+++ b/starling/node-2d.scm
@@ -53,6 +53,7 @@
<canvas>
cameras
+ first-camera
<scene-2d>
@@ -196,6 +197,11 @@
canvas)))
(cameras canvas)))
+(define-method (first-camera (canvas <canvas>))
+ (match (cameras canvas)
+ ((camera . _) camera)
+ (() #f)))
+
;;;
;;; 2D Scene