summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)))