Next: , Previous: , Up: Graphics   [Contents][Index]


2.3.4 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 Tiled. Chickadee has native support for loading and rendering Tiled maps in the (chickadee render tiled) module.

Procedure: load-tile-map file-name

Load the Tiled formatted map in file-name and return a new tile map object.

Procedure: tile-map? obj

Return #t if obj is a tile map.

Procedure: tile-map-orientation tile-map

Return the orientation of tile-map.

Procedure: tile-map-width tile-map

Return the width of tile-map in tiles.

Procedure: tile-map-height tile-map

Return the height of tile-map in tiles.

Procedure: tile-map-tile-width tile-map

Return the width of tiles in tile-map.

Procedure: tile-map-tile-height tile-map

Return the height of tiles in tile-map.

Procedure: tile-map-tilesets tile-map

Return the tilesets for tile-map.

Procedure: tile-map-layers tile-map

Return the layers of tile-map.

Procedure: tile-map-properties tile-map

Return the custom properties of tile-map.

Procedure: point->tile tile-map x y

Translate the pixel coordinates (x, y) into tile coordinates.

Procedure: draw-tile-map tile-map [#:layers] [#:region] [#:origin] [#:position] [#:scale] [#:rotation]

Draw the layers of tile-map. By default, all layers are drawn. To draw a subset of the available layers, pass a list of layer ids using the layers keyword argument.

Refer to draw-sprite (see Sprites) for information about the other arguments.

2.3.4.1 Tilesets

Procedure: tileset? obj

Return #t if obj is a tileset.

Procedure: tileset-name tileset

Return the name of tileset.

Procedure: tileset-first-gid tileset

Return the starting GID of tileset.

Procedure: tileset-size tileset

Return the number of tiles in tileset.

Procedure: tileset-tile-width tileset

Return the width of tiles in tileset.

Procedure: tileset-tile-height tileset

Return the height of tiles in tileset.

Procedure: tileset-atlas tileset

Return the texture atlas for tileset.

Procedure: tileset-tiles tileset

Return the tiles in tileset.

Procedure: tileset-properties tileset

Return the custom properties of tileset.

2.3.4.2 Tiles

Procedure: tile? obj

Return #t if obj is a tile.

Procedure: tile-id tile

Return the ID of tile.

Procedure: tile-animation tile

Return the animation for tile.

Procedure: tile-properties tile

Return the custom properties of tile.

2.3.4.3 Animations

Procedure: animation-frame? obj

Return #t if obj is an animation frame.

Procedure: animation-frame-tile frame

Return the tile for frame.

Procedure: animation-frame-duration frame

Return the duration of frame.

2.3.4.4 Layers

Procedure: tile-layer? obj

Return #t if obj is a tile layer.

Procedure: tile-layer-name layer

Return the name of layer.

Procedure: tile-layer-width layer

Return the width in tiles of layer.

Procedure: tile-layer-height layer

Return the height in tiles of layer.

Procedure: tile-layer-tiles layer

Return the tile data for layer.

Procedure: tile-layer-properties layer

Return the custom properties of layer.

Procedure: object-layer? obj

Return #t if obj is an object layer.

Procedure: object-layer-name layer

Return the name of layer.

Procedure: object-layer-objects layer

Return the objects for layer.

Procedure: object-layer-properties layer

Return the custom properties of layer.

2.3.4.5 Objects

Procedure: map-object? obj

Return #t if obj is a map object.

Procedure: map-object-id obj

Return the ID of obj.

Procedure: map-object-name obj

Return the name of obj.

Procedure: map-object-type obj

Return the type of obj.

Procedure: map-object-shape obj

Return the shape of obj.

Procedure: map-object-properties obj

Return the custom properties of obj.

2.3.4.6 Polygons

Procedure: polygon? obj

Return #t if obj is a polygon.

Procedure: polygon-points polygon

Return the list of points that form polygon.


Next: , Previous: , Up: Graphics   [Contents][Index]