Author Topic: Draggable items in a draggable panel  (Read 2195 times)

Tony

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Draggable items in a draggable panel
« on: November 15, 2013, 03:29:47 AM »
Hi,

I would like to have multiple draggable items in a draggable panel. I've made a timer that detects if the mouse has moved or not during a specific time, if the mouse have been at the same position then the event is detected as a drag-item-function, but if the mouse has moved I would like to activate the panel behind. How can I do this? Can I activate the OnPress function for the panel?

Br,
Tony

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Draggable items in a draggable panel
« Reply #1 on: November 15, 2013, 04:56:27 AM »
You can activate it by doing what UICamera does -- using SendMessage("OnPress", true);

Also... why would hover ever become a drag item? Do you mean if you press over an item for a certain period of time, ie press and hold? That would make more sense.

Tony

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Draggable items in a draggable panel
« Reply #2 on: November 15, 2013, 05:04:13 AM »
Yes, press and hold for dragging the item.

How do I specify what gameobject that should receive the "OnPress" event?

Tony

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Draggable items in a draggable panel
« Reply #3 on: November 15, 2013, 05:33:17 AM »
Now I think I've got it!

I just need to forward events from the draggable item to the panel behind it (like the UIForwardEvents script).

Thanks for the help!