Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Deepestblue on November 11, 2013, 01:21:49 PM

Title: Toggle/Button question
Post by: Deepestblue on November 11, 2013, 01:21:49 PM
Hi Aren,

sorry to bother with a quick question: I am trying to have some kind of mix between a Toggle and a Button. So, I would like to have the functionality of a toggle, but still have the option to have a Hover. I understand that I could add UIButton to my Toggle to have a color-based hover, but I'd need to have an image. Do I need to make the background of the Toggle an UIImageButton or is there another proper way to do it? Thanks for you help!
Title: Re: Toggle/Button question
Post by: ArenMook on November 11, 2013, 04:14:47 PM
Are you talking about visual? Because a widget wizard-created toggle actually has both scripts attached, and the button script is what does highlighting.
Title: Re: Toggle/Button question
Post by: Deepestblue on November 11, 2013, 05:11:04 PM
Yes, the visual. Please see attached pictures from the widget wizards.

The buttonimage gives me an option to choose the hover-image from the atlas and the toggle doesn't.

I'd like a functionality as toggle offers with the only difference that I'd need a hover-image to be able to be picked too so when I move the mouse over the toggle-switch, the hover-image is displayed instead of the the main image (background). UIButton which is on the toggle only offers me tinting.

Hope I expressed it better this time. :)
Title: Re: Toggle/Button question
Post by: ArenMook on November 12, 2013, 03:11:20 PM
I think I'll flat out remove the widget wizard in the next update. It's not meant to be used to create your UI as many people seem to assume. It's only meant to create your initial component, which you will then copy/paste around your scene after setting it up how you want.
Title: Re: Toggle/Button question
Post by: Deepestblue on November 12, 2013, 04:04:35 PM
I translate your unpolite answer to my original question simply as "No, it will not work by making the toggle-background an imagebutton, you will have to code something by yourself."
Title: Re: Toggle/Button question
Post by: ArenMook on November 13, 2013, 08:07:25 PM
Sorry, I didn't mean to come off as rude. I was merely remarking that a lot of people seem to misunderstand the use I intended for that gadget, so I will replace it with something better.
Title: Re: Toggle/Button question
Post by: dasoccerbomb on February 19, 2014, 04:01:42 PM
Deepestblue did you ever find a solution/workaround to have a UIToglle with ability to swap out a sprite when hovered?