Author Topic: OnHover while mouse button is pressed  (Read 2104 times)

Santos

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 4
    • View Profile
OnHover while mouse button is pressed
« 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!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OnHover while mouse button is pressed
« Reply #1 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.

Santos

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: OnHover while mouse button is pressed
« Reply #2 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?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OnHover while mouse button is pressed
« Reply #3 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.