Forum Libraries, Components, and Plugins

Layers / scenes over top of other layers / scenes

I'm looking for an example of showing a layer / scene over top of another layer, or something similar that would result in the same effect. For instance, something like this:

It seems most of the available examples have one scene being completely replaced by another via some sort of transition. Is something like the above screenshot possible with Cocossharp?

Best Answers


  • JaredMathesJaredMathes CAUniversity

    Thanks Jeremy,

    You did understand me correctly. And I get what your saying as well. I'm assuming I can do this sort of thing for "Options" screens, etc. I didn't know if there was some other way to accomplish this that was in line with best practices.

    One thing I did notice in games that do these types of screens / images is when they show, the background image darkens or fades out. My thought was that if I faded the existing layer or scene, it would also fade the victory image as well. Am I right in this assumption?

  • FlippyFlippy USMember ✭✭

    Well I'm definitely not the person to ask when it comes to best practices as I've only been using CocosSharp for a little over three months.

    With that being said, I have never attempted to layer my scene with another layer, but I can think of a few alternatives.

    1) Don't fade out the entire layer. Only fade out the background or sprites that you want to be darkened.
    2) Maybe use the "UpdateColor" method for sprites/backgrounds to give the effect of being darkened. I have used this method in the game I'm currently developing to let users know when certain heroes cannot be picked or have been knocked out of combat.
    3) I haven't tried this and it's probably not a good idea because of memory consumption, but you could overlay a partially transparent png over the entire screen which will give the scene that darkened look.

    I'm curious about this one myself so I'm hoping someone with more experience can comment on what would be considered best practices.

  • JaredMathesJaredMathes CAUniversity

    I noticed that a CCLayerColor has an opacity property. Perhaps for this type of case?

  • kjpou1kjpou1 LUMember, Xamarin Team Xamurai

    Hey guys

    We have something that might help out here.

    This pops up a layer over the other with a different color that includes alpha. Presents a menu and when the menu option is pressed removes the popup layer and returns to normal processing. Take notice of how PauseListeners and ResumeListeners are used.

    Does that help?

    There is a game built on CocosSharp called Sir-Lance-and-Hop and Support web site that uses this type of transform that Jared is looking for. Not sure if it uses the same as described above but the menu does scroll down from the top.

  • FlippyFlippy USMember ✭✭

    Thanks @KennethJPouncey. I think those demos will prove quite useful. The only samples I have really used are the ones from that Monkey Bananas game.

    I'll check out that game on my ipad too when I get home. Do you know of any other games on Itunes or GooglePlay that were developed using CocosSharp? I'd like to get an idea of how CocosSharp is currently being utilized.


  • kjpou1kjpou1 LUMember, Xamarin Team Xamurai


    It is on our wiki page.
    This is all that we know of. There may be others. People should just update that page or let us know so we can update it.

Sign In or Register to comment.