Can you use multiple images for tilemap loaded from CSV?
I'm loading a tilemap from a .csv file and I would like to know if there is a way to use multiple images to represent different values in the tilemap. I am using FlxBaseTilemap.loadMapFromCSV(). The function has an argument, FlxTilemapGraphicAsset, which it says contains all the tiles (the programmer) wants to use. But the type of the argument only contains a single image.
As far as I can tell from examples, I could make an image that is a grid of the tiles I want to use, and use that. But I would really like a way to use multiple images from my code if possible.
FlxTilemap doesn't really have a built-in way to do that, but one of the accepted graphic types is a
BitmapData. You could always programatically combine multiple images into a single
BitmapDatawith the entire grid, using
FlxFramesCollection. You could probably use
FlxTileFrames.combineTileSets(), which pretty much handles that
BitmapDatacombination logic for you.
In both cases you need the
BitmapDatafor the individual images, which you can get with
Ah, I see. That was what I wanted to know, thanks.
By the way, if anyone has a similar question in the future, I recommend the OpenFL API reference at https://api.openfl.org/. I've been using the HaxeFlixel API reference at https://api.haxeflixel.com, but they don't have any documentation for some classes, like BitmapData, beyond just listing the class member names.