How do I disable an actor when he is invisible?

keweworkshopkeweworkshop Member Posts: 377
edited November -1 in Working with GS (Mac)
How do I disable an actor when he is invisible?

I can't find the answer through my searches. I have a menu that pops up when a button is pushed. The menu is always there though, so if a user were to touch the screen even when the menu is invisible, it still works. How do I disable it? I think I am on the right track, I created a attribute called disable menu but i must not be plugging it in right. Please point to me a resource if you know where one is!

Comments

  • RedlerTechRedlerTech Member Posts: 1,583
    Is there a reason you're not just creating an additional screen?

    Well there's two things you could do.
    1) change the screen size width to 960 other than 480 & position your menu on the left, & other scene on the right, and just switch the camera origin when you hit play etc.

    2) create a game global boolean called Menu

    Put in all your menu actors:
    Rule: If game.Menu is true, change self.color.alpha to 1 and all your rules/behaviors
    OTHERWISE: change self.color.alpha to 0

    When play button is pressed change attribute Menu to false. When menu button is pressed, change to true.

    Matt :D
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    in your touch is pressed rule have it like this

    when touch is pressed AND when self color alpha =1 ( all conditions valid)

    that way when you change the alpha to 0 to make it invisible it disables the touch
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    in your touch is pressed rule have it like this

    when touch is pressed AND when self color alpha =1 ( all conditions valid)

    that way when you change the alpha to 0 to make it invisible it disables the touch
  • keweworkshopkeweworkshop Member Posts: 377
    @NextGen, I would like to have the menu pop up on whatever scene the user is on. But if I can't get it to work than I could just make an additional scene, thanks for the idea!

    @JohnPapiomitis Brilliant! I had not thought about it that way, going to try it now. Thanks!
  • keweworkshopkeweworkshop Member Posts: 377
    Yes! It works, great idea JohnPapiomitis. Thank you!
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Anytime glad i could help
  • calvin9403calvin9403 Member Posts: 3,186
    JohnPapiomitis said:
    in your touch is pressed rule have it like this

    when touch is pressed AND when self color alpha =1 ( all conditions valid)

    that way when you change the alpha to 0 to make it invisible it disables the touch
    just want to say maybe change self alpha =1 to >0

    ________________
    http://www.thatgameforum.com/
    http://gshelper.com/
    http://www.youtube.com/user/GameSaladCookbook#p/
    http://gamesalad.com/wiki/
    http://www.deepblueapps.com/Deep_Blue_Ideas_Ltd./Home.html
    http://www.gamesalad.es/
    http://thatgameforum.com/threads/gs-videos.360/
    my email: calvin9403@hotmail.com
    my skype: calvin9403
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    the reason i say=1 is because if you interpolate the alpha to 0, the touch rules will still be in effect during the interpolate. By having it =1 it disables it when the interpolate starts
  • calvin9403calvin9403 Member Posts: 3,186
    JohnPapiomitis said:
    the reason i say=1 is because if you interpolate the alpha to 0, the touch rules will still be in effect during the interpolate. By having it =1 it disables it when the interpolate starts

    maybe he wants so if it is interpolate then it can still be press

    anyway choose it your self kewe
Sign In or Register to comment.