summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sly/sprite.scm13
1 files changed, 9 insertions, 4 deletions
diff --git a/sly/sprite.scm b/sly/sprite.scm
index 3a304a6..c8e0fe4 100644
--- a/sly/sprite.scm
+++ b/sly/sprite.scm
@@ -81,14 +81,19 @@
(%make-sprite drawable position scale rotation color anchor vertices animator)
sprite?
(drawable sprite-drawable set-sprite-drawable)
- (position sprite-position set-sprite-position)
- (scale sprite-scale set-sprite-scale)
- (rotation sprite-rotation set-sprite-rotation)
- (color sprite-color set-sprite-color)
+ (position %sprite-position set-sprite-position)
+ (scale %sprite-scale set-sprite-scale)
+ (rotation %sprite-rotation set-sprite-rotation)
+ (color %sprite-color set-sprite-color)
(anchor sprite-anchor set-sprite-anchor)
(vertices sprite-vertices)
(animator sprite-animator))
+(define sprite-position (compose signal-ref-maybe %sprite-position))
+(define sprite-scale (compose signal-ref-maybe %sprite-scale))
+(define sprite-rotation (compose signal-ref-maybe %sprite-rotation))
+(define sprite-color (compose signal-ref-maybe %sprite-color))
+
(define (update-sprite-vertices! sprite)
(let ((texture (sprite-texture sprite)))
(pack-texture-vertices (sprite-vertices sprite)