Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Santos on December 11, 2014, 06:09:13 PM

Title: OnHover while mouse button is pressed
Post by: Santos on December 11, 2014, 06:09:13 PM
I want to listen to hover event on touch displays, and the original implementation does not dispatch if the "mouse" is down.

I found this post:
http://www.tasharen.com/forum/index.php?topic=5846.msg27678#msg27678

However, I was wondering if an official solution was created for this. As there are a lot of people working on the same project I'd prefer a solution that doesn't require me to change NGUI source code.

Thanks!
Title: Re: OnHover while mouse button is pressed
Post by: ArenMook on December 12, 2014, 11:29:15 PM
That post is too old.

You don't get OnHover on touch devices, but you get OnDragOver / OnDragOut. Listen for those.
Title: Re: OnHover while mouse button is pressed
Post by: Santos on December 15, 2014, 10:47:25 AM
I've done some tests with OnDragOver and checked the code, it seems like it will only dispatch if an object was "pressed".


If I put my finger on a empty spot and move it over an object it wont dispatch the OnDragOver, is this correct?
Title: Re: OnHover while mouse button is pressed
Post by: ArenMook on December 15, 2014, 12:56:24 PM
No, it will work regardless. There is always something underneath the touch, even if it's just an auto-set fallback object (the camera).

Assuming your NGUI is up to date, that is.