Changing the Visibility of an object

JustinMLJustinML Member Posts: 4
edited November -1 in Working with GS (Mac)
I'm having problems changing the visibility of an object while in a preview. When clicking on the menu bar, the bar changes the boolean attribute "showMenu" to true. The buttons for my menu have a rule so when showMenu is true, they call "self.Graphics.Visible" to true.

But nothing happens. Hellllllpppps :D

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    the self. graphics .visible attribute cant be changed in game

    what you want to be doing is changing self. color. alpha to 0 to make it invisible, and change it to 1 to make it visible

    cheers
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    the visible attribute cannot be changed in game.

    You will have to use Alpha and leave visible checked if you want to ever see it.

    Edit: one for you johnny boy. ;)
    ___________________________________________________________________________________
    TEMPLATES AND PROJECT HELP BY TENRDRMER. CLICK HERE!!!

    AppSolute Entertainment on Facebook
    AppSolute Entertainment on iTunes
  • allornothingallornothing Member, PRO Posts: 126
    I *think* you can't use rules with the visible attribute, and instead have to use the actors alpha. I might be wrong, but if you instead call 'self.graphics.alpha' to = 1 on the buttons (and have them set to 0 previously) then that should show them in the same way.
  • JustinMLJustinML Member Posts: 4
    The problem with changing the Alpha, is that you can still click on the object even if you can't see it. I guess I'll have to go with spawning the object when the menu is clicked.
  • mangaroomangaroo Member Posts: 419
    make it unclickable when alpha = 0 :)
  • JustinMLJustinML Member Posts: 4
    Hmm, didn't know that was an option. how would you do that?

    (Edit: Ahhh duh, in a rule.)
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    whatever behaviros or whatver you want to do when its clicked(but only when the alpha is 1)

    put them in a rule that is when touch is pressed AND when attribute self color alpha =1

    make sure its when all conditions are valid
  • JustinMLJustinML Member Posts: 4
    JohnPapiomitis said:
    whatever behaviros or whatver you want to do when its clicked(but only when the alpha is 1)

    put them in a rule that is when touch is pressed AND when attribute self color alpha =1

    make sure its when all conditions are valid

    Tyvm, thought of that right as I posted!
Sign In or Register to comment.