Author Topic: Disabling mouseover interaction on Draggable Panel  (Read 1624 times)

stromdotcom

  • Guest
Disabling mouseover interaction on Draggable Panel
« on: December 19, 2013, 05:18:52 PM »
Hello-

I am porting a game to Mac OSX from iOS/Android.  My UI is perfect except for one issue.  I have a draggable panel that occasionally has to be moved offscreen, redrawn, and then slid back on screen with SpringPanel.

All works great except for one issue: if the mouse hovers over the panel while SpringPanel is springing it in, the tween seems to stop.  No clicking, no interaction, just if the mouse is over the panel the springpanel tween ends.  If the panel moves to where the mouse happens to be, it stops.

I need to disable this -- is there a way I can tell the panel NOT to respond to mouseover events this way?  I don't think I really need any mouseover interaction in this game (since it is a port of a mobile game and that has no equivalent on mobile) but if I could at least disable it for this panel I would be in good shape.

[edit] To be more clear, the mouse over event seems to be interrupting the SpringPanel tween.  I just checked the items on the panel.  There is a grid made up of sprites and buttons, but none of them have handlers that should handle mouse over as far as I can tell.  Also my grid has a UICenterOnChild component.

The more I think about this the more confusing it is.  I can't imagine why on earth a draggable panel would need to respond to OnHover at all.  Or a Tween, or anything in my UI except maybe buttons.  But even still, I can't find where it happens to comment it out.

[edit2] I have more info on this.  It isn't just OnHover that causes this.  Its when the mouse MOVES while over the panel.
« Last Edit: December 19, 2013, 06:14:11 PM by stromdotcom »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Disabling mouseover interaction on Draggable Panel
« Reply #1 on: December 20, 2013, 12:27:20 PM »
What version of NGUI? You mention draggable panel, but they are now called scroll views. Panels don't react to mouse events in any way. Colliders do. Enable debugging on your UICamera and figure out which collider is under your mouse when the problem occurs. Then check what scripts are on that collider's object.

stromdotcom

  • Guest
Re: Disabling mouseover interaction on Draggable Panel
« Reply #2 on: December 20, 2013, 01:22:42 PM »
I am using 2.2.3.  Older version because this is a port of a game that has been in development for over a year and is already out on 2 platforms.

I'll check the debugging right now...

[edit] No debugging option on UICamera in this version, apparently.

But luckily it's easy to see what is under it.

Anchor
-- Panel
----DraggablePanel
------Grid (with UICenterOnChild)
--------GameObject (no scripts)
----------UISprite (with UIDragPanelContents AND a Box Collider)

I'm not sure why that UISprite has a box collider but disabling it appears to fix the problem!

[edit] 

Well, I take that back.  The tween interrupting stops, but its only because I have removed the Scroll Axis Name, Vertical Axis Name and Horizontal Axis Name from the camera.  But that causes a bunch of this:

UnityException: Input Axis  is not setup.
 To change the input settings use: Edit -> Project Settings -> Input
UICamera.Update () (at Assets/NGUI/Scripts/UI/UICamera.cs:685)

Unchecking "Sticky ToolTip" makes that error go away.
« Last Edit: December 20, 2013, 01:40:25 PM by stromdotcom »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Disabling mouseover interaction on Draggable Panel
« Reply #3 on: December 21, 2013, 02:34:18 AM »
Sorry, but I can't support such an old version. I can only support the latest release.

There have simply been too many changes since 2.2.3 for me to even remember what the issue may have been caused by, and when it was fixed.

FYI 2.2.3 was released on October 15, 2012. That's over a year ago.