summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dave@izanagi>2013-06-23 11:09:07 -0400
committerDavid Thompson <dave@izanagi>2013-06-23 11:09:07 -0400
commit4becd612832be831a841f68dadb045a1c5cf060b (patch)
tree334dd6b49a0d416923ecd353069e02ea9271d2eb
parent4e6d8acd9cab2841178080db8dfd921f0434a8e7 (diff)
Add default sprite arguments to load-sprite.
-rw-r--r--2d/sprite.scm16
1 files changed, 9 insertions, 7 deletions
diff --git a/2d/sprite.scm b/2d/sprite.scm
index c5310f7..13bd496 100644
--- a/2d/sprite.scm
+++ b/2d/sprite.scm
@@ -55,18 +55,20 @@
(rotation sprite-rotation set-sprite-rotation!)
(color sprite-color set-sprite-color!))
-(define* (make-sprite texture #:optional (x 0) (y 0) (scale-x 1) (scale-y 1)
- (rotation 0) (color '(1 1 1)))
- (%make-sprite texture x y scale-x scale-y rotation color))
-
(define (set-sprite-scale! sprite scale)
"Sets sprite scale-x and scale-y to the same value."
(set-sprite-scale-x! sprite scale)
(set-sprite-scale-y! sprite scale))
-(define (load-sprite filename)
- "Loads a sprite from file with default position, scaling, and rotation values."
- (make-sprite (load-texture filename)))
+(define* (make-sprite texture #:optional (x 0) (y 0) (scale-x 1) (scale-y 1)
+ (rotation 0) (color '(1 1 1)))
+ "Makes a new sprite object."
+ (%make-sprite texture x y scale-x scale-y rotation color))
+
+(define* (load-sprite filename #:optional (x 0) (y 0) (scale-x 1) (scale-y 1)
+ (rotation 0) (color '(1 1 1)))
+ "Loads a sprite from file."
+ (make-sprite (load-texture filename) x y scale-x scale-y rotation color))
(define (draw-sprite sprite)
"Renders a sprite."