dismissing a window

zachdragozachdrago Member Posts: 11
edited November -1 in Working with GS (Mac)
I have a Menu button, and when you click it, it brings up a window with a Reset button, a Home button, and a Levels button. In the corner of the window I have an X that I want to close and dismiss the actors that I called forward. However, I'm not sure how to do that at all. If anyone can help me or suggest another way of doing it, it would be greatly appreciated! Thanks!

Comments

  • VoidedSkyVoidedSky Member Posts: 1,095
    Attribute: game.dismiss

    X button:
    ----Rule, when touch is pressed change game.dismiss to true
    ----Timer After .5 seconds change dismiss to false, and destroy actor

    All other menu objects
    ----Rule, When game.dismiss is true, destroy actor

    This should work
  • PhoticsPhotics Member Posts: 4,172
    I did mine a little differently for my latest game, as the pop-up window may have multiple elements in it and I wanted to keep the window as a single actor.

    Rule... if touched is pressed
    ....rule (All)
    ....rule if touch is > (mouse position X... left side)
    ....rule if touch is < (mouse position X... right side)
    ....rule if touch is > (mouse position Y... bottom side)
    ....rule if touch is < (mouse position Y... top side)
    ....destroy actor
  • zachdragozachdrago Member Posts: 11
    CowTechMan said:
    Attribute: game.dismiss

    X button:
    ----Rule, when touch is pressed change game.dismiss to true
    ----Timer After .5 seconds change dismiss to false, and destroy actor

    All other menu objects
    ----Rule, When game.dismiss is true, destroy actor

    This should work

    thanks! that worked perfectly!
  • PhoticsPhotics Member Posts: 4,172
    Heh, while converting my app to the iPod Touch / iPhone, I seem to have realized something. My approach to multiple touch points in an actor might be the reason for my game's longer than usual loading times.
  • POMPOM Member Posts: 2,599
    @photics - i use the same method you use for multiple areas of touch for a single actor..

    are you saying it is slower? then have another actor above to trigger the touch?

    (bad english i know, im trying!)
  • PhoticsPhotics Member Posts: 4,172
    Actually, I don't know what's going on.

    I saved the title screen for the last part of my iPad to iPod conversion. I'm having trouble getting it done. It might be something unrelated, like out-of-memory issues.

    I think my game has too many rules, which is slowing down the game. I added a lot of rules with multiple languages, and a lot of rules are needed to add multiple touch points in a single actor.
  • POMPOM Member Posts: 2,599
    try optimize your rules with swiches, so that they dont apply till needed
    like puting a bunch of rules in A master rule called "ACTIVE" and the rules will be checked only
    when ACTIVE is true, but you probably know that ;)
Sign In or Register to comment.