Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Game Whiz on September 03, 2012, 10:56:16 AM

Title: Checkmark not appearing in checkbox
Post by: Game Whiz on September 03, 2012, 10:56:16 AM
Hi,

I have a checkbox in a panel that behaves just as expected. However if I uncheck the checkbox, deactivate the UI (SetActive or SetActiveRecursively to false) and activate the UI, the checkbox checkmark doesn't appear again when I try to check it. the state is changed, since if I check it (nothing appears), and then deactivate and activate the GUI again, it appears checked.

Bug or something I'm doing wrong?

Best regards,
Alex
Title: Re: Checkmark not appearing in checkbox
Post by: ArenMook on September 03, 2012, 03:27:59 PM
When the UIButton / UIButtonColor is enabled, it records the current color as the "starting" color. Since you faded it out, the starting color has the alpha of 0.
Title: Re: Checkmark not appearing in checkbox
Post by: Game Whiz on September 03, 2012, 05:13:51 PM
That's not it. The starting color does indeed have alpha=0 when I reactivate the gui, but it then tweens to alpha=1 when I click on the checkbox. The problem is that the checkmark isn't appearing even with alpha=1. If I deactivate and activate the checkmark in the editor during runtime, it then correctly appears.
Title: Re: Checkmark not appearing in checkbox
Post by: Game Whiz on September 03, 2012, 05:39:33 PM
The problem was that the panel in which the checkbox was, was marked as static. I had clicked to clear the static checkmark, but I failed to notice that under Unity 4.0 the static field in the panel isn't clickable (and the panel continued as static). It's a Unity bug that you probably should report. A quick fix is to get rid of the GUILayout.Width() in the UIPanelInspector.
Title: Re: Checkmark not appearing in checkbox
Post by: ArenMook on September 04, 2012, 12:40:02 AM
Yup, this bug has been reported to Unity as far as I know. Phil mentioned it before. It's a regression issue, so I hope they will fix it soon.