2D Toolkit Forum

2D Toolkit => Support => Topic started by: Highstorm on January 05, 2015, 02:32:52 am

Title: Help with adding Color Tint to Tilemap Brush
Post by: Highstorm on January 05, 2015, 02:32:52 am
Hi. In the TileMap editor, I would like to be able to adjust the color tint of my selected sprites, before I paint them. This is different from the in-built "Color Channel" feature of the editor as it would be directly modifying the "Color" attribute of the Tk2dSprite on a tile-by-tile basis.

I've searched the forum for a similar request, but came up empty handed. So I've been digging through the editor code, trying to find where I could splice it in myself, but I'm having trouble finding where exactly I can get access to this property.

If someone could point me in the right direction, I would greatly appreciate it.
Title: Re: Help with adding Color Tint to Tilemap Brush
Post by: unikronsoftware on January 05, 2015, 10:30:26 am
There isn't a tk2dSprite for each tile, everything is merged into the larger partition system. You could, I suppose change the tilemap colors so they aren't interpolated - that way, the tiles would use a solid color each. tk2dTileMapMeshBuilder.cs, BuildForChunk is where this happens, look for
Code: [Select]
Color color = Color.Lerp(
  Color.Lerp(tileColorx0y0, tileColorx1y0, tileColorX),
  Color.Lerp(tileColorx0y1, tileColorx1y1, tileColorX),
  tileColorY);

You can also change it so painting a tile down will paint a color down at those positions as well, if you wanted to take it further.
Title: Re: Help with adding Color Tint to Tilemap Brush
Post by: Highstorm on January 05, 2015, 04:04:40 pm
Ah, I see. Thank you for the quick reply!