×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    21

    Creating a modal alert?

    Hello everybody!

    Is it possible to create an Alert which makes the app halt until the dialog is dismissed (by time or by a keypress e.g) ?

    In my game I'm using an Alert to display the user that he has reached the next level. Before displaying the Alertbox, I stopped (canceled) the game-timer. Then I dislpay the alert with display.setCurrent(alert, gameScreen). And after that statement I setup the next level and re-schedule the timer.
    I thought that the new level and the timer - statements will be executed when the alert has been dismissed (by time or by user). But right after displaying the alert the program continues with setting up the level and scheduling the timer. Then game-timer runs while the alert is still beeing shown!!

    Thanks for your help!!

  2. #2
    Registered User
    Join Date
    Jul 2003
    Location
    Finland, Tampere
    Posts
    1,113
    Why display.setCurrent(alert, gameScreen) could be modal?

    This way you would not be able to change any screen

  3. #3
    Registered User
    Join Date
    Oct 2003
    Posts
    21
    Sorry, I do not quite understand what you mean by that.

    I also tried something like

    display.setCurrent(alert);
    display.setCurrent(gameScreen);

    but nothing worked. How can I then make the app wait until the alert is dismissed? Thanks again!

  4. #4
    Registered User
    Join Date
    Jul 2003
    Location
    Finland, Tampere
    Posts
    1,113
    You have to pause all your threads. You cannot make an Alert call modal

  5. #5
    Registered User
    Join Date
    Oct 2003
    Posts
    21
    Yes, I know. I do pause my thread(s)! But when do I have to continue them? To be more precise: How can I get to know when the alert is dismissed in order to reschedule the thread?
    Thank you very much for your help!

  6. #6
    Registered User
    Join Date
    Jul 2003
    Location
    Finland, Tampere
    Posts
    1,113
    I think your Canvas should receive hideNotify when Alert is about to be shown and showNotify, when Alert dismisses

  7. #7
    Registered User
    Join Date
    Oct 2003
    Posts
    21
    Hmmm, that could be a way that will work!!

    Thank you very much, I'll give it a try! Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×