Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: PatientRock on Mon 20/12/2010 14:06:40

Title: hiding a user mode
Post by: PatientRock on Mon 20/12/2010 14:06:40
I've created a user mode which has a corresponding image in the icon bar.  Have managed to get it working beautifully.  Now, I don't want the user mode to be available in the beginning of the game but later at a chosen moment. 

How would I hide this user mode in the icon bar and later make it available?  A gentle push in the right direction would be appreciated.

Thanks
Title: Re: hiding a user mode
Post by: on Mon 20/12/2010 14:15:06
By setting the VISIBLE flag of the button to false in game_start and later to true. That will leave a gap in the GUI's design though, so a workaround would be to change the buton's graphics (NormalGraphic) to look like the GUI background and ONLY respond to clicks when the graphic is different:

if (BUTTON.NormalGraphic == BackgroundGraphic)
{
  // do nothing!
}
else
{
  // set the mode
}

Hope that helps!
Title: Re: hiding a user mode
Post by: monkey0506 on Mon 20/12/2010 15:52:14
Instead of having to change the NormalGraphic, you could just have a "disabled" version of the button image flattened into the GUI background. Whenever the Button was visible it would cover up the disabled version..

..but, Ghost..if the alternate NormalGraphic looked like the GUI background..wouldn't that be the same (visually) as having the Visible property set to false?
Title: Re: hiding a user mode
Post by: on Mon 20/12/2010 18:20:08
Quote from: monkey_05_06 on Mon 20/12/2010 15:52:14
..but, Ghost..if the alternate NormalGraphic looked like the GUI background..wouldn't that be the same (visually) as having the Visible property set to false?

It would, yes, but since Rock asked for pointers, I saw no harm in giving two. It's almost Xmas, after all  ;)
Title: Re: hiding a user mode
Post by: PatientRock on Mon 20/12/2010 23:02:55
Thanks guys - quite helpful!