Efficient FlxKey#toString, FlxTileblock#setTile, overridable FlxState#open/close #1300
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A few changes, here:
FlxKey#toString
seeing as that is very memory intensive. The method I have used requires an extra map, which seems a bit repetitive, but definitely better at runtime.FlxTileblock
so that asetTile()
method could be added. Really, in the long run, I think HaxeFlixel would benefit from something more like HaxePunk'sTiledImage
, which can have the texture offset and clipped to a specific rectangle, also with animation, and simply a betterFlxTilemap
for when more control is needed over specific tiles (Right now the fact that it is not a FlxSprite and had all it's own rendering makes it incredibly limited).FlxState#open/close
, so I made them non-inline, which will have negligible performance impact given how infrequently they are called.