SXCompiledTileMap

type:
extension
author:
Malcolm
description:
A tilemap setup for sparrow using compiled sprites as the rendering method
compatible:
v1.1
tag:
tilemap, sparrow, 8bit
homepage:
https://gist.github.com/896866
download:
https://gist.github.com/gists/896866/download

Usage

You create a tilemap with CSV data and an image strip, then use the camera to scroll.

NSString *mapPath = [[NSBundle mainBundle] pathForResource:@"small_map" ofType:@"csv"];
NSString *csvData = [[NSString alloc] initWithContentsOfFile:mapPath 
                                      encoding:NSUTF8StringEncoding error:nil];
SXCompiledTileMap *tm = [[SXCompiledTileMap alloc] 
                          initWithViewportSize:CGSizeMake(320, 480) 
                          CSVData:csvData tileSize:CGSizeMake(16, 16)
                          andTileImage:[UIImage imageNamed:@"sample_tiles.png"]];
[self addChild:tm];

Changelog

  • 2011/04/11 22:35: First public version

Source Code

Discussion

No comments so far. Feel free to edit this part of the page.

  extensions/sx_compiled_tilemap.txt · Last modified: 2015/09/14 11:15 (external edit)
 
Powered by DokuWiki