Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 2 Support (Qt 5) › Pause on onApplicationPaused:

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #12306

    Cho

    Hi again,

    I am making my games with the structure from the tutorial Multi level Multi Scene…

    And, there is Main.qml where GameWindow is written…

    And, there is gameScene.qml where the game scene is working…

    I want to pause my game on ph call coming…

    And, there is already a pause method in gameScene used for pause button and already tested.

    So, I add the following code in Main.qml but nothing is working…

    onApplicationPaused:
        {
            gameScene.pause()
        }
        onApplicationResumed:
        {
            gameScene.pause()
        }

    I tried to add other codes but absolutely nothing is working…

    Is onApplicationPaused: not working?

    Help me please…

    #12307

    Cho

    I got it. This method only triggered only when user picks up the phone or reads the msg. But, I also want to pause the game even if user doesn’t pick up the phone or open the msg. How can I implement that?

    #12331

    Günther
    Felgo Team

    Hi Cho!

    We currently only provide these two signals for pausing or resuming. They are fired based on changes in the Qt.application.state.
    You can create a similar handler yourself:

    Connections {
        target: Qt.application
    
        onStateChanged: {
          console.debug("App state changed to", Qt.application.state)
        }
      }

    Maybe you can use this to detect an incoming call also based on a state change. If an incoming call doesn’t cause a state change, I guess a more native approach is needed (e.g. trying to detect an incoming call with native Android Java code, but this won’t run cross-platform then).

     

     

Viewing 3 posts - 1 through 3 (of 3 total)

RSS feed for this thread

You must be logged in to reply to this topic.