Open SeiferTim opened 3 months ago
we talked about this in discord, sounds like you want a loadMapFromArray
but without graphic data, I suggest we make an equivalent for loadMapFromCSV
, loadMapFromArray
, loadMapFrom2DArray
and loadMapFromGraphic
, I'm thinking
setTilesFromCSV
, setTilesFromArray
, setTilesFrom2DArray
and setTilesFromGraphic
we talked about this in discord, sounds like you want a
loadMapFromArray
but without graphic data, I suggest we make an equivalent forloadMapFromCSV
,loadMapFromArray
,loadMapFrom2DArray
andloadMapFromGraphic
, I'm thinkingsetTilesFromCSV
,setTilesFromArray
,setTilesFrom2DArray
andsetTilesFromGraphic
Makes sense to me.
When the ONLY thing you are changing is the data, and nothing else needs to change (widthByTiles
, AutoTiles
, etc) makes no sense to go through the whole loadMap
stuff again.
whoever implements this, consider what happens if this is called before a graphic is set, is it possible for that to work without crashing or should we warn or throw an error? should we also add a way to set the graphic? should setGraphic work for this, will that set _tileWidth and stuff?
Currently, if you want to change the value(s) of a
FlxTilemap
you can either callsetTile
or one of theload
functions.If you want to replace the entire tilemap's data, you have to loop through each tile, or call a
load
function and pass all the parameters, including the tile graphic again.If the tile graphic no longer exists, this is not viable.
I propose a function:
setData
which would take anArray<Int>
and just replaces_data
with this new array and does all the updating stuff thatsetTile
needs to do.