summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sly/render/tileset.scm11
1 files changed, 11 insertions, 0 deletions
diff --git a/sly/render/tileset.scm b/sly/render/tileset.scm
index 0122471..2047f6f 100644
--- a/sly/render/tileset.scm
+++ b/sly/render/tileset.scm
@@ -24,6 +24,7 @@
(define-module (sly render tileset)
#:use-module (srfi srfi-9)
+ #:use-module (srfi srfi-9 gnu)
#:use-module (srfi srfi-42)
#:use-module (sly render texture)
#:export (<tileset>
@@ -48,6 +49,16 @@
(margin tileset-margin)
(spacing tileset-spacing))
+(set-record-type-printer! <tileset>
+ (lambda (tileset port)
+ (format port
+ "#<tileset texture: ~a width: ~d height ~d margin: ~d spacing: ~d>"
+ (tileset-texture tileset)
+ (tileset-width tileset)
+ (tileset-height tileset)
+ (tileset-margin tileset)
+ (tileset-spacing tileset))))
+
(define (split-texture texture width height margin spacing)
"Split TEXTURE into a vector of texture regions of WIDTH x HEIGHT
size. SPACING refers to the number of pixels separating each