2.1.1: 2D HUD plus 3D view, how?

2.1.1: 2D HUD plus 3D view, how?
0

Hi…

I try to draw a 2D HUD and behind a 3D scene. This should work, I have found the working 3D example in the “example collection”.

My 2D Canvas is still projected to 3D. I suppose because my “Main Camera” hasn’t set this ui option:

In my project the Ui option is missing. Where to get it?

Thanks

Mike

Hello

I think you can find your answer about culling mask in the documentation :
https://docs.cocos2d-x.org/creator/2.1/manual/en/render/camera.html?h=culling

In short, each of your nodes belongs to a group (“Default” by default). You can set it in the node properties after you created the groups you want in the project settings (and call it “Background”, “UI”, or anything you like).
Then, you juste have to choose which group your camera will render.

Hope it helps.

Hi yoif5,

I have overlooked the camera documentation totally. This works.

Thank you very much

Mike

Maybe it could also be a option for you, to use 2x Cams. One orthogonal for UI, one perspective for 3D stuff.

Hi sledgehammer,

yes, that is what I have tried, but I have forgotten to use different groups for the different cameras (e.g. ui for 2D cam, default for 3D cam).

Thanks

Mike

Okay. Hope you got further with your project :innocent:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.