Hello Guest

Author Topic: sprite SortingOrder max layer?  (Read 4506 times)

Velvety

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 19
    • View Profile
    • Velvety Couch Games
sprite SortingOrder max layer?
« on: September 13, 2013, 05:01:12 pm »
I'm using 2D Toolkit to render my own isometric tiled map with tk2dSprites.  Drawing tiles in the correct order for isometric maps is very important for making sure it looks correct.  I am using the sprite's SortingOrder to do this, however it seems that any number higher than about 5000 makes the sprite disappear completely.   A SortingOrder of 4000 works fine.

My isometric tiled map has up to 26000 tiles and so up to 26000 render layers.  How come the support for SortingOrder seems to cut off around 5000?  Is this a bug or an intentional restriction?

The new editor variable for this is labelled "Sorting Order In Layer" does that mean I can group sprites into Unity Layers for further draw order control?  Or does that have to be done via Z axis manipulation?

Velvety

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 19
    • View Profile
    • Velvety Couch Games
Re: sprite SortingOrder max layer?
« Reply #1 on: September 13, 2013, 06:09:06 pm »
Ok I've figured out how the SortOrder is working (by setting the mesh's bounds 0.01 units closer to camera).  I realize now that the max SortOrder is relative to how far away the camera is from the sprites (mine was -50 units away and so it could only see things up to about 50*1/0.01=5000 in SortOrder).

I've moved my camera back to -1000 so now it can show things up to about 1000*1/0.01=100000

I'm not sure if there is any potential down side to having that much space between the camera and the actual visible game units, but so far it works fine.

Thanks!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: sprite SortingOrder max layer?
« Reply #2 on: September 13, 2013, 08:11:13 pm »
There isn't any downside, you just move it back as far as you need it to be. Within floating point limits of course, but you're not gonna run into that with a few thousand sprites.