Hello Guest

Author Topic: tk2dCamera: Sort mode Orthographic reverts to Default  (Read 4556 times)

zeitweise

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
tk2dCamera: Sort mode Orthographic reverts to Default
« on: October 11, 2013, 11:46:53 pm »
Hello,

I don't see what I am missing here: I upgraded to tk2d 2.20 final + hotfix

Now my z-ordering is broken. I figured out that using these options works: Projection: "Perspective", Sort mode: "Orthographic".
My problem: Always when I enter play mode (or when I make a build) the camera’s sort mode reverts back to "Default".

Best regards
@zeitweise



unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dCamera: Sort mode Orthographic reverts to Default
« Reply #1 on: October 12, 2013, 10:09:45 pm »
Hi,

This was an issue - I believe it should be fixed in 2D Toolkit 2.2.2 - please let me know if its still broken there and I'll investigate this further.

zeitweise

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: tk2dCamera: Sort mode Orthographic reverts to Default
« Reply #2 on: October 13, 2013, 05:30:39 pm »
Hello,

thanks for the reply. I’ve updated to 2.2.2. now but unfortunately it is still broken. It does not matter if I use my old project or setup a new one.

Best regards
@zeitweise


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dCamera: Sort mode Orthographic reverts to Default
« Reply #3 on: October 14, 2013, 01:18:01 pm »
Ok. I've investigated this - I will add a better fix to the next version, but for now I suggest setting it in the tk2dCamera.Start function, or your own script (you don't need tk2dCamera for a perspective camera anyway).

The older behaviour in 2.0 was leaking memory - the transparencysortmode function shouldn't be called every frame as it allocates memory. Turns out that value isn't saved in Unity, which makes the current fix not work as it should.

zeitweise

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: tk2dCamera: Sort mode Orthographic reverts to Default
« Reply #4 on: October 14, 2013, 05:24:20 pm »
Thanks.

I manually added

   void Start() {
      camera.transparencySortMode = TransparencySortMode.Orthographic;
   }

to tk2dCamera.cs

and that seems to work.

I am looking forward to an update but this will work for now.

Best regards
@zeitweise