Is it possible to have a Layer or Scene keep on the screen no matter what scene change?

Is it possible to have a Layer or Scene keep on the screen no matter what scene change?
0.0 0

#1

I am not sure the keywords of this question so I would like to post it here first.

I am writing a game, which has a panel to display the player information.
It has to be kept all along menu, game and other functionality.

The ideal case which I love to see is, the top half of the screen will keep this panel.
And the bottom half can be changed as usual scene transition etc.

Since I would like to have the transition effect only to the below part of the screen, and have the data loaded only when scene change.

Please let me know if my concept is wrong.


#2

You can Inflate your layer with top panel and retain it. Then always when you run next scene add back your top panel.


#3

Use CCDirector setNotificationNode function for Top panel.


#4

Dawid Drozd wrote:

You can Inflate your layer with top panel and retain it. Then always when you run next scene add back your top panel.

Thanks for the reply.

I am currently using this with Singleton, but it is not ideal since the scene transition will affect this.


#5

juyoung kim wrote:

Use CCDirector setNotificationNode function for Top panel.

Thanks for the reply.

I have just tried this.

Maybe I didn’t do it well that the schedule and the CCMenuItem is not working.

Please advise if anything more I can do.


#6

Because CCDirectore NotifiactionNode is not called onEnter() func automatically.
So, you must called onEnter() func manually.

Just call onEnter().
If you not used schedule and CCMenuItem, also just call onExit().

Jonathan Yeung wrote:

juyoung kim wrote:
> Use CCDirector setNotificationNode function for Top panel.
>
Thanks for the reply.
>
I have just tried this.
>
Maybe I didn’t do it well that the schedule and the CCMenuItem is not working.
>
Please advise if anything more I can do.


#7

juyoung kim wrote:

Because CCDirectore NotifiactionNode is not called onEnter() func automatically.
So, you must called onEnter() func manually.
>
Just call onEnter().
If you not used schedule and CCMenuItem, also just call onExit().
>
>
Jonathan Yeung wrote:
> juyoung kim wrote:
> > Use CCDirector setNotificationNode function for Top panel.
>
> Thanks for the reply.
>
> I have just tried this.
>
> Maybe I didn’t do it well that the schedule and the CCMenuItem is not working.
>
> Please advise if anything more I can do.

Thanks again. It works now.

Just find some memory leak coming up at the same time that I can handle that.