Hello Guest

Author Topic: Tilemap origin or anchor point  (Read 6439 times)

davilca

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Tilemap origin or anchor point
« on: November 07, 2014, 09:32:09 pm »
Hello, I'm Dani, new to 2D Toolkit (and new to Unity).

I'm starting a pixel art game with tilemap based levels. I have created a camera with 400 x 240 pixels native resolution, with bottom left anchor point. Then I have created a tilemap with the same size (i.e, 25 x 15 tiles, 16 x 16 pixels each tile, a total of 400 x 240 pixels map).

In the scene editor, the tilemap appears displaced 8 pixels to the left and 8 pixels to the bottom. Why the camera and the tilemap don't align if they have the same size?

The camera bounds screenshot:



The tilemap bounds screenshot:



In this second screenshot, I can see the Tile Properties, and Origin is set to x=-8, y=-8. Does this have something to do with the issue?

Anyway, when I build and run the game, it seems to render correctly.

Thanks in advance.

Dani.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap origin or anchor point
« Reply #1 on: November 07, 2014, 11:32:43 pm »
Your sprites probably have the anchor point set to middle center (default), change them to bottom left, or simply offset your tilemap to compensate. The tilemap at position 0, 0, 0 will be exactly the same as a sprite at the same position - having the anchor set correctly on the sprite will ensure it matches your camera at bottom left.

davilca

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Tilemap origin or anchor point
« Reply #2 on: November 08, 2014, 11:17:42 am »
Ok, they align now. I changed the anchor point of each tile to Lower Left, perfect!

By the way, is it still necessary to register my copy of 2D Toolkit to access the private forum or can I ask for support here in the public forum as well?

Thanks!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap origin or anchor point
« Reply #3 on: November 08, 2014, 03:17:50 pm »
Just approved your account now, registering lets you download beta versions + gives you access to the private support forum, and we generally prioritise registered users when answering questions.