Support => NGUI 3 Support => Topic started by: laurentl on April 03, 2013, 03:43:27 PM
Title: selecting and highlighting an item in a list
Post by: laurentl on April 03, 2013, 03:43:27 PM
I noticed that the list example (panel) doesn't select anything or highlight the items. How do I do that any example ?
Title: Re: selecting and highlighting an item in a list
Post by: ArenMook on April 03, 2013, 05:18:40 PM
Add a collider to the item(s). Don't forget to UIDragPanelContents on the collider as well so that it continues dragging the panel like before.
Title: Re: selecting and highlighting an item in a list
Post by: laurentl on April 03, 2013, 05:49:58 PM
That's what I have so I'll give additional details of what I want to achieve and what I get: When I click on an item I want it to center, highlight and also perform an action. To perform the action I added a delegate to UICenterOnChild like so:
UICenterOnChild c = gridParent.GetComponent<UICenterOnChild>();
c.onFinished+=delegate{ChooseColor ("boo");};
But this only works after the item centers, I'd like this action to happen as soon as I click them.
Title: Re: selecting and highlighting an item in a list
Post by: laurentl on April 03, 2013, 05:58:58 PM
I think I figured out : when you have a button that has a collider, if you add a DragContentPanel the button won't eat the event and let the user drag the button. So then having the event sent is just a matter of setting a UIButtonMessage