Hello Guest

Author Topic: Problems about using NGUI's Camera with 2D Toolkit's Camera  (Read 14628 times)

HIDEO KOJIMA

  • Newbie
  • *
  • Posts: 6
    • View Profile
Problems about using NGUI's Camera with 2D Toolkit's Camera
« on: August 20, 2013, 01:49:40 pm »
Hi admin and communitication !

I'm using NGUI and 2D Toolkit together for my game. I'm using NGUI for GUI and 2D Toolkit for only animation, sprites...
But I have problems with camera.

* First, i create Camera of NGUI for only GUI :
 - I created layer is GUI for element of NGUI.
 - Camera' attribute are:
    + Clear Flags : Skybox
    + Culling Mask : GUI
    + Projection : Orthographic
    + Size : 1
    + Depth : 1
* After that: I create an another camera, but it of 2D Toolkit with name is tk2dcamera.
- Camera' attribute are:
    + Clear Flags : Skybox
    + Culling Mask : Everything exception GUI layer.
    + Projection : Orthographic
    + Size : 30
    + Depth : 0

Then, i create sprites collection with size is 30.

But when i play, only show background of NGUI's Camera, and sprites of 2D Toolkit's Camera did not show.

So, How i can show sprite of 2D Toolkit' Camera with GUI of NGUI's Camera together ? Many Thanks


« Last Edit: August 20, 2013, 01:52:23 pm by HIDEO KOJIMA »

gary-unikronsoftware

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 74
    • View Profile
Re: Problems about using NGUI's Camera with 2D Toolkit's Camera
« Reply #1 on: August 20, 2013, 02:24:42 pm »
Hi,

On the settings for your NGUI camera, try changing the Clear Flags value to 'depth only' to see if that fixes the problem.

Thanks.

HIDEO KOJIMA

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Problems about using NGUI's Camera with 2D Toolkit's Camera
« Reply #2 on: August 20, 2013, 02:41:51 pm »
I did changed Clear Flags value to Depth Only, but nothing change, sprite of 2D Toolkit' camera did not show. :( I did modify with a day, but i can fix it ! :(

gary-unikronsoftware

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 74
    • View Profile
Re: Problems about using NGUI's Camera with 2D Toolkit's Camera
« Reply #3 on: August 20, 2013, 03:18:32 pm »
If you disable your NGUI camera can you see the sprites from the tk2d camera?  Can you also post screenshots of how both your cameras are set up?

thanks.

HIDEO KOJIMA

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Problems about using NGUI's Camera with 2D Toolkit's Camera
« Reply #4 on: August 20, 2013, 03:50:08 pm »
When i disable NGUI camera, i will see sprites from 2D Toolkit Camera :(. This is my setup camera. Mixed are Default, Water, Ignore Raycase, TransparentFX.
« Last Edit: August 20, 2013, 06:06:53 pm by HIDEO KOJIMA »

gary-unikronsoftware

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 74
    • View Profile
Re: Problems about using NGUI's Camera with 2D Toolkit's Camera
« Reply #5 on: August 20, 2013, 04:41:20 pm »
I have tried to recreate the problem using a NGUI camera and a tk2d camera in my environment using the same settings as you have, but both the GUI element and the sprite were drawn as expected.

Can you export a simple copy of your project which shows the problem happening, and send to our support email support@unikronsoftware.com so we can investigate further.

Thanks.
« Last Edit: August 20, 2013, 04:57:18 pm by gary-unikronsoftware »

HIDEO KOJIMA

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Problems about using NGUI's Camera with 2D Toolkit's Camera
« Reply #6 on: August 20, 2013, 05:08:37 pm »
I'm using Unity 4.2. So it is problems with me ? What version that you are using ? Thanks.

gary-unikronsoftware

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 74
    • View Profile
Re: Problems about using NGUI's Camera with 2D Toolkit's Camera
« Reply #7 on: August 20, 2013, 05:14:31 pm »
I am also using Unity 4.2

HIDEO KOJIMA

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Problems about using NGUI's Camera with 2D Toolkit's Camera
« Reply #8 on: August 20, 2013, 05:23:02 pm »
Maybe i was created sprites collection wrong, could you give me simply soulution to create correct sprites collection ? Many Thanks
« Last Edit: August 20, 2013, 05:34:43 pm by HIDEO KOJIMA »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Problems about using NGUI's Camera with 2D Toolkit's Camera
« Reply #9 on: August 20, 2013, 05:37:38 pm »
If you can see the sprites without the NGUI camera visible, you've clearly got it working. Its obviously something you've got wrong on the NGUI camera that draws after that.

As gary said, send a repro case to support at unikronsoftware.com if you'd like us to look at it.


HIDEO KOJIMA

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Problems about using NGUI's Camera with 2D Toolkit's Camera
« Reply #10 on: August 20, 2013, 05:46:21 pm »
I did find problems, if i'm using both camera, then sprite will draw behind bacground of NGUI camera, so we can see sprites of 2D Toolkit camera. But i still not fix it :)

gary-unikronsoftware

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 74
    • View Profile
Re: Problems about using NGUI's Camera with 2D Toolkit's Camera
« Reply #11 on: August 21, 2013, 09:00:02 am »
If I understand this correctly, your tk2dCamera sprites are being drawn but they are being drawn behind your GUI sprites?  This is what you would expect, so I'm not sure where the problem is?

Clavigne

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Problems about using NGUI's Camera with 2D Toolkit's Camera
« Reply #12 on: October 16, 2013, 08:10:31 pm »
Is it possible to define the render order of 2dtoolkit in relation to NGUI?
We had certain 2dtk assets rendering above NGUI, but since updating to the latest NGUI and 2DToolKit packages form the Asset store, this is no longer the case.

Does anyone know of how to draw 2dtk assets above NGUI? Is this no longer possible?




unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Problems about using NGUI's Camera with 2D Toolkit's Camera
« Reply #13 on: October 17, 2013, 01:21:03 am »
If you use 2 cameras, then you can explicitly control what draws first.