Author Topic: Draggable Panel Events  (Read 2695 times)

gregmax17

  • Guest
Draggable Panel Events
« on: December 26, 2012, 02:31:41 PM »
Are there events for the scrollable panels? I would like to know the event when it starts and ends. And when it ends, the "centeredObject" (or selected) object.

Just a quick point in the right direction and quick sample code is all I need please :)

Thanks in advance!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Draggable Panel Events
« Reply #1 on: December 26, 2012, 06:04:11 PM »
I am pretty sure there are event notifications on the SpringPanel script that's used to move the panel to begin with that you can tie into.

gregmax17

  • Guest
Re: Draggable Panel Events
« Reply #2 on: December 26, 2012, 07:24:34 PM »
I looked at the SpringPanel script, and... I have to modify core code? That doesn't seem safe. Or am I missing something?

Hopefully updates in the future doesn't remove my modified code.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Draggable Panel Events
« Reply #3 on: December 27, 2012, 12:42:07 AM »
SpringPanel.onFinished callback. Just set it to something.

gregmax17

  • Guest
Re: Draggable Panel Events
« Reply #4 on: December 27, 2012, 09:23:56 AM »
There is not SpringPanel.onBegin though

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Draggable Panel Events
« Reply #5 on: December 27, 2012, 12:04:00 PM »
Nope. You're the one that starts it, so I assume you know where it begins.

gregmax17

  • Guest
Re: Draggable Panel Events
« Reply #6 on: December 27, 2012, 06:46:14 PM »
No... I am look at the "UICenterOnChild.cs" script, it starts it. I can't pass an on start event... unless I modify this code (again, which is core code, not safe to do when you have updates). Right?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Draggable Panel Events
« Reply #7 on: December 27, 2012, 08:27:51 PM »
It's perfectly safe if you make a copy of that script and modify that. ;)

gregmax17

  • Guest
Re: Draggable Panel Events
« Reply #8 on: December 27, 2012, 08:29:37 PM »
Ha! ok, I will do that