Created
April 7, 2016 17:28
-
-
Save Beeblerox/e5ac1530bf1da41f1e28885ba727c560 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tileWidth:Int = 32; | |
var tileHeight:Int = 32; | |
var tileSize:FlxPoint = new FlxPoint(tileWidth, tileHeight); | |
var tileSpacing:FlxPoint = new FlxPoint(2, 2); // we need to add spacing between tile images | |
var tileBorder:FlxPoint = new FlxPoint(2, 2); // and add borders around tiles (copy some pixels around tile images) | |
var tileFrames:FlxTileFrames = FlxTileFrames.fromBitmapAddSpacesAndBorders("your/tileset/image", tileSize, tileSpacing, tileBorder); // this method just takes original image, creates new one and generates required collection of frames, which can be loaded in tilemap or sprite | |
tilemap.loadMapFromCSV(mapData, tileFrames); // all tilemap loading methods can take tile frames collection as a source of graphics for them |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment