summaryrefslogtreecommitdiff
path: root/2d
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@member.fsf.org>2013-09-15 22:48:02 -0400
committerDavid Thompson <dthompson@member.fsf.org>2013-09-15 22:48:02 -0400
commit9efc09b4f5cf61158504d7255069e2c56a102b13 (patch)
tree5dc30a68ba14f58b33ac4135da9bb913f090a84e /2d
parent68dab43f0230fd54176e07b3ee2e119dfd44e25f (diff)
Clean up docstrings for tileset module.
Diffstat (limited to '2d')
-rw-r--r--2d/tileset.scm16
1 files changed, 9 insertions, 7 deletions
diff --git a/2d/tileset.scm b/2d/tileset.scm
index e07336b..e3a97f0 100644
--- a/2d/tileset.scm
+++ b/2d/tileset.scm
@@ -47,8 +47,10 @@
(spacing tileset-spacing))
(define (split-texture texture width height margin spacing)
- "Splits a texture into a vector of texture regions of width x height
-size."
+ "Split TEXTURE into a vector of texture regions of WIDTH x HEIGHT
+size. SPACING refers to the number of pixels separating each
+tile. MARGIN refers to the number of pixels on the top and left of
+TEXTURE before the first tile begins."
(define (build-tile tx ty)
(let* ((x (+ (* tx (+ width spacing)) margin))
(y (+ (* ty (+ height spacing)) margin)))
@@ -62,8 +64,8 @@ size."
(define* (make-tileset texture width height
#:optional #:key (margin 0) (spacing 0))
- "Returns a new tileset that is built by splitting the given texture
-into tiles."
+ "Return a new tileset that is built by splitting TEXTURE into
+tiles."
(let ((tiles (split-texture texture
width
height
@@ -73,8 +75,8 @@ into tiles."
(define* (load-tileset filename width height
#:optional #:key (margin 0) (spacing 0))
- "Returns a new tileset that is built by loading the given texture
-file and splitting the texture into tiles."
+ "Return a new tileset that is built by loading the texture at
+FILENAME and splitting the texture into tiles."
(let* ((tiles (split-texture (load-texture filename)
width
height
@@ -83,5 +85,5 @@ file and splitting the texture into tiles."
(%make-tileset tiles width height margin spacing)))
(define (tileset-ref tileset i)
- "Returns the tile at index i."
+ "Return the tile texture of TILESET at index I."
(vector-ref (tileset-tiles tileset) i))