summaryrefslogtreecommitdiff
path: root/2d
diff options
context:
space:
mode:
authorDavid Thompson <dave@izanagi>2013-06-23 11:14:02 -0400
committerDavid Thompson <dave@izanagi>2013-06-23 11:14:02 -0400
commite8be6c28ff61e1febf3a7c2d21ffacd772c487c9 (patch)
treef1429ddb45ebd058951c87146833f6a27604637e /2d
parent4becd612832be831a841f68dadb045a1c5cf060b (diff)
Use keyword arguments in make-sprite and load-sprite.
Diffstat (limited to '2d')
-rw-r--r--2d/sprite.scm12
1 files changed, 7 insertions, 5 deletions
diff --git a/2d/sprite.scm b/2d/sprite.scm
index 13bd496..aa86448 100644
--- a/2d/sprite.scm
+++ b/2d/sprite.scm
@@ -60,15 +60,17 @@
(set-sprite-scale-x! sprite scale)
(set-sprite-scale-y! sprite scale))
-(define* (make-sprite texture #:optional (x 0) (y 0) (scale-x 1) (scale-y 1)
- (rotation 0) (color '(1 1 1)))
+(define* (make-sprite texture #:optional #:key (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)))
+(define* (load-sprite filename #:optional #:key (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))
+ (make-sprite (load-texture filename) #:x x #:y y
+ #:scale-x scale-x #:scale-y scale-y
+ #:rotation rotation #:color color))
(define (draw-sprite sprite)
"Renders a sprite."