Hello Guest

Author Topic: Tilemaps and tk2DCamera  (Read 7287 times)

gabriel_ca

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Tilemaps and tk2DCamera
« on: August 04, 2012, 07:10:40 pm »
So I may have done something wrong here, since I'm both new to unity and 2d kit, but there seems to be a bug with tilemaps and a tk2DCamera.

Basically the tile map (which I did import from a TMX) came up way too small.  What's interesting is that if I set the sprite sheet for the tilemap to use the tk2DCamera the sprites themselves are the right size, but all jumbled together in one little spot.  If I set the sprite sheet to not use the tk2DCamera, the sprites are way to small, but if I zoom in on the tile map it looks like the map I expect.  It's just ridiculously tiny :).  Looks like the geometry for each quad is off in this use case.

  If I set the scale factor to something like 100 for X and Y and the sprite sheet doesn't use the tk2DCamera then it starts to look like something I can use, but guessing what scale factor to use just seems wrong ;)

This may end up being moot for me in the long run since I'm not sure I want to use tk2DCamera or not (I'm just exploring my options right now), but if I do want it, then I think tilemaps should behave like the sprites and be the right size :P

I can send my little test project if needed.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemaps and tk2DCamera
« Reply #1 on: August 04, 2012, 07:23:03 pm »
Hi,

This looks like the Tile size isn't correct. Could you try going to Settings, and then in Tile Properties, click "Reset sizes". If this doesn't fix it, please send me a repro case to support@unikronsoftware.com and I'll get this sorted out.

gabriel_ca

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Tilemaps and tk2DCamera
« Reply #2 on: August 04, 2012, 07:27:37 pm »
Ah ha!  That did it :)  Thanks for the prompt reply!  I knew buying into this toolkit was a good idea after seeing all the features and the great support you've been giving :)

Is this something that can be fixed so that I don't have to do that every time in a future release?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemaps and tk2DCamera
« Reply #3 on: August 04, 2012, 07:49:53 pm »
You won't have to if your tilemap is created AFTER the sprite collection is modified to enable tk2dCamera - it won't affect any newly created tilemaps using this collection. It doesn't automatically grab the values from the sprites as you could set it up with overlap, information which can't be obtained from the sprite colleciton.

gabriel_ca

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Tilemaps and tk2DCamera
« Reply #4 on: August 04, 2012, 08:08:09 pm »
I did make the sprite collection first and set it to use tk2D camera first, however I figured out the order of things I need to do.  When I created the tilemap, I just went down the list of things in the editor that need to be changed, which isn't the order that the tilemap editor likes it seems.

By default it picked a different sprite collection that had different properties, not the one I wanted it to use.  I created the Tile Map Data, then the Editor Data, then finally set the sprite collection for my tile map.  That seems to be what caused it.  If I set the collection prior to creating the two data objects all worked well when I imported the TMX.

Perhaps changing the order that these options are displayed, or reseting the tiles sizes when the sprite collection gets changed would help others not fall into the same problem.  What do you think?

Keep up the good work!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemaps and tk2DCamera
« Reply #5 on: August 04, 2012, 08:15:05 pm »
I could change it automatically when the sprite collection changes, but that would actually break cases where the user has gone in and tweaked to cope with overlapping tiles. But then again, how frequently do people do that? I'll think about this, its definitely better to cater for how the majority of people use this.

gabriel_ca

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Tilemaps and tk2DCamera
« Reply #6 on: August 04, 2012, 08:31:05 pm »
Could always track if the values have been manually set instead of automatically generated in that edge case (IMHO) throw up a dialog warning them what will happen, or give them an option to leave the values alone.  Just a thought.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemaps and tk2DCamera
« Reply #7 on: August 04, 2012, 09:41:01 pm »
Yesl Agreed. I'll get this sorted out the next time I focus on the tilemap editor.

Edit: This is why I really appreciate feedback. Sometimes I am so drowned in what I'm doing that certain obvious things aren't really that clear or at least as clear it should be.

gabriel_ca

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Tilemaps and tk2DCamera
« Reply #8 on: August 05, 2012, 12:40:08 am »
Glad I could help. :)

Sucks when you don't have a large QA department to point stuff out eh? ;)  We devs tend to get too close to what we are working on and miss what only a fresh set of eyes (like someone like me in this case, coming at the tool fresh) would see or run into issues with the workflow.

If other things pop up I'll post about it, or would you prefer email's for feedback?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemaps and tk2DCamera
« Reply #9 on: August 05, 2012, 01:16:22 am »
Forum would probably be slightly better as if the feature request / suggestion was a bit polarizing there would be feedback from others.

Thanks again!