From 9c99fc7d12a5c90555b649ed845ab28d6a1b174c Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 28 Jan 2018 10:34:14 -0500 Subject: render: Add Tiled map renderer. * chickadee/render/tiled.scm: New file. * Makefile.am (SOURCES): Add it. * doc/api.texi (Tile Maps): New subsection. --- doc/api.texi | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'doc/api.texi') diff --git a/doc/api.texi b/doc/api.texi index e2864a5..82cde8f 100644 --- a/doc/api.texi +++ b/doc/api.texi @@ -551,6 +551,7 @@ blocks to implement additional rendering techniques. * Rendering Engine:: Rendering state management. * Textures:: 2D images. * Sprites:: Draw 2D images. +* Tile Maps:: Draw 2D tile maps. * Lines and Shapes:: Draw line segments and polygons. * Fonts:: Drawing text. * Blending and Depth Testing:: Control how pixels are combined. @@ -773,6 +774,31 @@ Refer to @code{draw-sprite} (@pxref{Sprites}) for information about the other arguments. @end deffn +@node Tile Maps +@subsection Tile Maps + +A tile map is a scene created by composing lots of small sprites, +called ``tiles'', into a larger image. One program for editing such +maps is called @url{http://mapeditor.org,Tiled}. Chickadee has native +support for loading and rendering Tiled maps in the @code{(chickadee +render tiled)} module. + +@deffn {Procedure} load-tile-map @var{file-name} +Load the Tiled formatted map in @var{file-name} and return a new tile +map object. +@end deffn + +@deffn {Procedure} draw-tile-map @var{tile-map} [#:layers] [#:region] @ + [#:origin] [#:position] [#:scale] [#:rotation] + +Draw the layers of @var{tile-map}. By default, all layers are drawn. +To draw a subset of the available layers, pass a list of layer ids +using the @var{layers} keyword argument. + +Refer to @code{draw-sprite} (@pxref{Sprites}) for information about +the other arguments. +@end deffn + @node Lines and Shapes @subsection Lines and Shapes -- cgit v1.2.3