Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: loopyllama on April 17, 2012, 11:14:00 AM

Title: checkbox starting unchecked
Post by: loopyllama on April 17, 2012, 11:14:00 AM
I have a checkbox that I wish to start unchecked. I achieve this but I always see the checkbox in the gui checked, then I see it disappear. In my game, the player sees this when they load a new level and hit pause. My menu pops up and the checkbox gets checked for a split second, then turns off.

What is the best way to get a checkbox to not appear on for a splt second?
Example: place a check box in unity, turn off "starts checked", hit play. Notice the check box appears checked, then turns off. I wish for the user to not see it ever checked if it is indeed in the "off" state.
Title: Re: checkbox starting unchecked
Post by: loopyllama on April 17, 2012, 01:25:03 PM
I have found a working solution. It appears if I set the button to isChecked = false in Awake () then the menu will appear unchecked at the start. It looks like the code has a special case: if you call isChecked before awake it will directly set the alpha of the check mark to the state you pass it.
Title: Re: checkbox starting unchecked
Post by: joreldraw on April 17, 2012, 04:49:50 PM
This is a solution if ever you need to start unchecked.
I use playerpref to store status with a bol and when i start my app i check and set status stored with uichecbox.ischecked
Title: Re: checkbox starting unchecked
Post by: ArenMook on April 17, 2012, 06:25:09 PM
Btw, UISavedOption script can be used to automatically store the state of the checkbox in PlayerPrefs (or a group of radio buttons made out of checkboxes).
Title: Re: checkbox starting unchecked
Post by: mmuller on September 09, 2012, 02:54:08 PM
ArenMook,

Just to confirm, where should the UISavedOption be placed for a radio set? On each individual checkbox or the Radio Root?

Regards,

mm
Title: Re: checkbox starting unchecked
Post by: ArenMook on September 09, 2012, 05:23:16 PM
Depends on what you have. If you have a group of checkboxes set up in a radio button group, then the radio root. Otherwise, individual checkboxes.