~~NOTOC~~ ====== SXCompiledTileMap ====== ---- dataentry extension ---- type : extension #or 'mod' if it requires changing the Sparrow source author_mail : pixelrevision@gmail.com Malcolm description : A tilemap setup for sparrow using compiled sprites as the rendering method #enter a short description of the extension lastupdate_dt : #the date you created the extension compatible : v1.1 #the Sparrow version you tested the extension with depends : #if the ext. depends on others, list them here tags : tilemap, sparrow, 8bit #enter a few tags, separated by commas homepage_url : https://gist.github.com/896866 #if the ext. has an URL (e.g. a Gist-page), add it here download_url : https://gist.github.com/gists/896866/download #a direct link to the download (e.g. the Gist-archive) ---- ===== 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 ===== %gist(896866)% ===== Discussion ===== //No comments so far. Feel free to edit this part of the page.//