Pop-out Menu and GPGS(Google Play Game Service)

  • MoseHas
    Likes 0

    Problem Description

    Hi there.

    There are several questions that I would like to ask.

    #1

    Last time I solved the popout menu by creating a new scene. But now I want to create a simple pop out menu such as a confirm dialog.

    For example, if I want to quit the game, it will ask “Are you sure to quit?” but I don’t want to create a new scene for this.

    I tried to create a new sublayer in my GameLayer and add some sprites on the layer. Turns out it worked well. However, there was a problem. The sub-background did cover on the top of the layer, but I could still click the stars underneath it. I need to add a confirm dialog and prevent clicking the lower layer. How can I implement this function?

    #The original display

    #Call out the sublayer and add the HelloWorld sprite.

    #Still I can click the stars below the HelloWorld sprite. How could I prevent it?

     

    #2

    I have seen there is a tutorial video about GPGS(Google Play Game Service).

    https://www.youtube.com/watch?v=ykW_QWq5sqA

    And I also found this on the GooglePlayDeveloper page.

    https://developers.google.com/games/services/cpp/api/annotated

    Normally I use cpp, and yet the tutorial is for including JS into cpp. Will there be a simple tutorial for cpp class gpg?

     

    Thank you.

  • Sonar Systems admin
    Likes 0

    1. Create a boolean variable called isPaused which is checked around the logic for clicking the stars.
    2. Use these videos http://www.sonarlearning.co.uk/coursepage.php?topic=game&course=sonar-cocos-helper

     


    This reply has been verified.
  • MoseHas
    Likes 0

    I thought there will be a pop-out menu object that we can use or something like that.

    So there is no other way but set boolean to turn on/off the onTouch function?

    Thank you.

  • Sonar Systems admin
    Likes 0

    Not that I know of.


    This reply has been verified.
  • MoseHas
    Likes 0

    Well, ok. I was expecting there would be a much more convenient class for the function.

    Thanks anyway.

  • Sonar Systems admin
    Likes 0

    We will look into creating it for our Cocos Helper in the UI plugin coming soon


    This reply has been verified.
  • MoseHas
    Likes 0

    We beginners appreciate your effort so much!


    This reply has been verified.
  • Sonar Systems admin
    Likes 0

    Glad to be of assistance


    This reply has been verified.
  • barabasandras1
    Likes 0

    I did this by creating a new class inherited from Layer. When it initalizes I just pause every listener that is linked to it’s parent layer (which is the game background actually). 


    This reply has been verified.
  • MoseHas
    Likes 0

    sounds like a pretty good method as well, thank you!


    This reply has been verified.
  • Sonar Systems admin
    Likes 0

    Sounds good :D


    This reply has been verified.

Login to reply