diff options
author | David Thompson <dave@izanagi> | 2013-06-23 11:09:07 -0400 |
---|---|---|
committer | David Thompson <dave@izanagi> | 2013-06-23 11:09:07 -0400 |
commit | 4becd612832be831a841f68dadb045a1c5cf060b (patch) | |
tree | 334dd6b49a0d416923ecd353069e02ea9271d2eb /2d | |
parent | 4e6d8acd9cab2841178080db8dfd921f0434a8e7 (diff) |
Add default sprite arguments to load-sprite.
Diffstat (limited to '2d')
-rw-r--r-- | 2d/sprite.scm | 16 |
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." |