Hello Guest

Author Topic: Orthographic camera and tilemap boundaries don't match up  (Read 3513 times)

rwarlion

  • Newbie
  • *
  • Posts: 1
    • View Profile
Orthographic camera and tilemap boundaries don't match up
« on: October 09, 2013, 08:33:20 am »
I'm probably missing something fundamental, and I'm sure there's a reason, but I'm curious about this:

I have an orthographic camera with 1 pixel per meter, using the bottom-left as it's origin.
I have a 1024x1024 tile map (16x16 pixels per tile, 64x64 tiles).
I'm trying to keep the camera within the boundary of the tile map's edges.
When both are positioned at (0, 0), the edges of the camera don't line up with the edges of the tile map. The camera is 8 pixels off, so in order to get them to line up, I need to offset my camera by (-8, -8).

Why does it behave like this? Is there some way to get them to line up without offsetting the camera, or is there a reason I shouldn't be doing this?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Orthographic camera and tilemap boundaries don't match up
« Reply #1 on: October 09, 2013, 09:43:47 am »
The anchor of the sprites in the sprite collection determines the origin in the tilemap. I'm guessing its at middle center or something like that right now? Setting the anchor of the sprites to bottom left should fix this.