Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: CBYum on February 12, 2014, 07:15:06 AM
-
I have a scroll view that contains a vertical list of buttons. I can scroll the list of buttons quite happily and also click them individually - sweet. The only small problem left is their highlighting. When I begin a drag the button I touch will highlight to its pressed color. If I then drag it so my cursor is outside of the buttons original bounds it de-lights. The problem now however is that if I continue and drag back to that starting button position the button will light up again.
What I would like is for the button to cancel its interaction (and so de-light) when I start dragging (over a threshold) and never do anything else until the drag action has finished.
Any suggestions?
Thanks
-
Create a class derived from UIButton and change its OnPress, OnDragOut and OnDragOver functions. Add a member variable "bool mArmed = false;" Set it to 'true' when you get OnPress(true). In OnDragOut, set it to false. In OnDragOver check to see if it's true. If it is, call base.OnDragOver, otherwise do nothing.
-
Thanks, will give it a go.