Author Topic: Dynamic FlxTilemap Tile Colorization  (Read 1738 times)

uafg

  • New Member
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Dynamic FlxTilemap Tile Colorization
« on: Sat, Apr 18, 2015 »
Hi! I just have one question for a certain feature I want to implement..

I was wondering if there is a certain way or method that specific tiles in a tile sheet can be colorized dynamically when a FlxTilemap is loaded.

For example, let's say the image attached was a tile sheet and I wanted to load into a FlxTilemap, how would I go about - for example - changing the white color to a red or green one and changing the different shades to a certain color for a specific tile (for example, the last tile)



Thank you in advance!  :)

Minverva

  • Active Member
  • ***
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Re: Dynamic FlxTilemap Tile Colorization
« Reply #1 on: Sat, Apr 18, 2015 »
This?

http://forums.flixel.org/index.php/topic,3011.msg18225.html#msg18225

On a side note, I never really looked at FlxTileMap before. I was messing around with it and it is really neat. The only problem is that my game is built around using FlxTileBlocks and so all the AI and other logic based on colliding with FlxTileBlocks doesn't work with FlxTileMaps.

It would be extremely tedious to change it to affect FlxTileMaps and I'd be asking for a lot of bugs in the process. Do you know any way for FlxTileMap to add FlxTileBlocks instead? That would be really useful.

uafg

  • New Member
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Dynamic FlxTilemap Tile Colorization
« Reply #2 on: Sun, Apr 19, 2015 »
This?

http://forums.flixel.org/index.php/topic,3011.msg18225.html#msg18225

On a side note, I never really looked at FlxTileMap before. I was messing around with it and it is really neat. The only problem is that my game is built around using FlxTileBlocks and so all the AI and other logic based on colliding with FlxTileBlocks doesn't work with FlxTileMaps.

It would be extremely tedious to change it to affect FlxTileMaps and I'd be asking for a lot of bugs in the process. Do you know any way for FlxTileMap to add FlxTileBlocks instead? That would be really useful.

Thanks for the response, I'll probably try it out.

Unfortunately, I'm not sure right now of how to actually go about using FlxTileBlocks since I'm fairly new to flixel and I'm just trying to experiment with what I could do with FlxTilemaps

Minverva

  • Active Member
  • ***
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Re: Dynamic FlxTilemap Tile Colorization
« Reply #3 on: Sun, Apr 19, 2015 »
I think FlxTileBlocks might use less resources. I've been manually creating levels with them for the past few weeks. Some of the fun things you can do with them are do give them velocity, drag and make their solid property equal to false (fake walls). Invisible walls are easy to do by setting visible to false, but I prefer making them difficult to see by using a different tileset.

I suspect you can probably do some similar things with FlxTileMaps - and using multiple flxtilemaps with different properties on the same level is probably fine (i.e. have one FlxTileMap of objects moving onto or off the world bounds).

Honestly, I think I'd be using FlxTileMaps now if I'd noticed them. I'm using FlxTileBlocks mainly because that's what Mode used and I think Adam probably used them because of either the resource issue or he found it easier to randomly generate levels with them.

uafg

  • New Member
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Dynamic FlxTilemap Tile Colorization
« Reply #4 on: Mon, Apr 20, 2015 »
Okay, thank you very much for your advice, I think I'll manage myself from now on  :)