Hello Guest

Author Topic: Help with adding Color Tint to Tilemap Brush  (Read 3847 times)

Highstorm

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Help with adding Color Tint to Tilemap Brush
« 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Help with adding Color Tint to Tilemap Brush
« Reply #1 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.

Highstorm

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Help with adding Color Tint to Tilemap Brush
« Reply #2 on: January 05, 2015, 04:04:40 pm »
Ah, I see. Thank you for the quick reply!