Closed Geokureli closed 1 month ago
It's now easier to extend FlxTypedTilemap, all you need now is to override createTile, like so:
FlxTypedTilemap
createTile
class SpecialTile extends FlxTile { public var specialField:SpecialType; public function new (tilemap:SpecialTilemap, index, width, height, visible, allowCollisions) { this.specialField = Global.getSpecialValue(index); super(cast tilemap, index, width, height, visible, allowCollisions); } } class SpecialTilemap extends FlxTypedTilemap<SpecialTile> { override function createTile(index, width, height, visible, allowCollisions) { return new SpecialTile(this, index, width, height, visible, allowCollisions); } }
you can also use the existing method, which is to override initTileObjects and create all the tiles, there
initTileObjects
It's now easier to extend
FlxTypedTilemap
, all you need now is to overridecreateTile
, like so:you can also use the existing method, which is to override
initTileObjects
and create all the tiles, there