summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-08-27 11:26:43 -0400
committerDavid Thompson <dthompson2@worcester.edu>2014-08-27 11:26:43 -0400
commit318b28053599249873e6cb89714953beb56774cc (patch)
treea4afd1b8bf57ccea657c6851a8164cea5d4ddec0
parentdcff08b746f7bf84551ba6452b571b751f766226 (diff)
sprite: Add load-sprite procedure.
* sly/sprite.scm (load-sprite): New procedure.
-rw-r--r--sly/sprite.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/sly/sprite.scm b/sly/sprite.scm
index 59583db..064ec66 100644
--- a/sly/sprite.scm
+++ b/sly/sprite.scm
@@ -37,6 +37,7 @@
#:use-module (sly signal)
#:use-module (sly texture)
#:export (make-sprite
+ load-sprite
make-animated-sprite))
;;;
@@ -65,6 +66,11 @@
(vector s2 t2)
(vector s1 t2)))))))
+(define* (load-sprite file-name #:optional #:key (shader (load-default-shader)))
+ "Return a sprite mesh for the texture loaded from FILE-NAME.
+Optionally, a custom SHADER can be specified."
+ (make-sprite (load-texture file-name) #:shader shader))
+
(define* (make-animated-sprite textures frame-duration #:optional #:key
(loop? #t)
(shader (load-default-shader)))