Author Topic: Colliders for containers.  (Read 1803 times)

turkeypotpie

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Colliders for containers.
« on: March 21, 2013, 08:37:42 PM »
I'm looking for a way of getting the OnHover event for a container, with a number of widgets inside.

I can put a collider over the container using NGUITools.AddWidgetCollider, but it looks like NGUI only supports events for ONE object under the mouse at a time.

Any way around this, besides hacking UICamera.cs?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Colliders for containers.
« Reply #1 on: March 22, 2013, 01:58:27 AM »
You will need to either forward events, or have behaviour scripts on all colliders. For example for a scrollable panel, you need UIDragPanelContents on the background and on objects within the draggable panel.

turkeypotpie

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: Colliders for containers.
« Reply #2 on: March 22, 2013, 02:16:59 PM »
I ended up using UICamera.hoveredObject by checking whether it's a child of my container.  Seems to work fine ..