Hello Guest

Author Topic: Painting irregular size tiles with the tilemap.  (Read 10462 times)

fluffy_fleshwall

  • Newbie
  • *
  • Posts: 3
    • View Profile
Painting irregular size tiles with the tilemap.
« on: August 15, 2012, 09:06:48 am »
Hi, first let me mention that I am very new to both unity and 2DTK.

My problem is the following. I created a sprite collection containing the sprites I want to put in my tile map. for the purposes of making a test I created 4 128x128 tiles and one 128x256 tile. This is because the tiles I will be painting later will be sliced into their full objects.

Painting the 128x128 tiles works like a charm.
Painting the 128x256 tile over a clear area works as well.
But painting the 128x256 tile over a previous tile only paints the first 128x128 area and the rest of it is never painted.

I have attached a screenshot of the problem as well.

Any help would be greatly appreciated!

MooNiZZ

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 63
    • View Profile
Re: Painting irregular size tiles with the tilemap.
« Reply #1 on: August 15, 2012, 11:08:33 am »
A tilemap should never use irregular sprites. That's a no-no.
You should split the 128x256 up in 2 tiles instead.
Import the image as a spritesheet and define it as 128x128 in the collection editor, and you'll get 2 sprites out of it.
« Last Edit: August 15, 2012, 11:24:00 am by MooNiZZ »

fluffy_fleshwall

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Painting irregular size tiles with the tilemap.
« Reply #2 on: August 15, 2012, 11:24:49 am »
Got another plugin called Unitile, works like a charm.

MooNiZZ

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 63
    • View Profile
Re: Painting irregular size tiles with the tilemap.
« Reply #3 on: August 15, 2012, 11:33:20 am »
Still, best practice is to never use irregular sized sprites for a tilemap. And Uni-tile probably do the exact same thing I explained, just automatically. The rest of the functionality is in the 2d Tool Kit.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Painting irregular size tiles with the tilemap.
« Reply #4 on: August 15, 2012, 07:33:53 pm »
You can actually use irregularly sized sprites should you want to. It helps if you have the anchor points at a corner rather than the center... Try it on an empty tilemap - it should work there. The tiles are sorted in a particular order, from the bottom left by default. So if you paint your larger tile on the left, and paint something on the tile to the right, you'll only see the first half. You can change the tsort method in the tilemap > Settings > Sort Method.

Also, in tile properties, you can change size to increase or decrease the overlap.

Its intentional that the tilemapper doesn't stop you from painting into the adjacent tiles even though the current one has "written into" it - it is required for overlapping & isometric tiles in a tilemap.

MooNiZZ

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 63
    • View Profile
Re: Painting irregular size tiles with the tilemap.
« Reply #5 on: August 15, 2012, 07:54:30 pm »
Still, it's not really made for irregular sized sprites. check image below
And one shouldn't, if you aim to actually work with this as a profession you would be turned down immediately if you used irregular sized images in a tilemap.



unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Painting irregular size tiles with the tilemap.
« Reply #6 on: August 15, 2012, 08:26:17 pm »
Yeah I agree. Irregular meshes aren't the target for this feature, but rather overlapping tiles. I don't really see the point of irregular sprites either, as they can be 2 normal sprites side by side - but if needed you can use it as described in my reply above. It might even make sense in some workflows, when not painting directly into a spritesheet, for example.

fluffy_fleshwall

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Painting irregular size tiles with the tilemap.
« Reply #7 on: August 16, 2012, 08:50:48 am »
In the end I got what I wanted from Unitile, and I think its functionality is well worth a look for the 2DTK. It allowed me to import an already hand made tile set map, define the grid size, select the grids I want and then paint them. I needed the functionality for the prototype I'm currently making. A top down RTS for mobile platforms.

MooNiZZ

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 63
    • View Profile
Re: Painting irregular size tiles with the tilemap.
« Reply #8 on: August 16, 2012, 08:57:14 am »
An already hand made tile set map? You mean a spritesheet? That's possible with tk2d