Author Topic: Can't set up UIDraggablePanel  (Read 5925 times)

derkoi

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 57
    • View Profile
Can't set up UIDraggablePanel
« on: June 02, 2012, 02:33:04 AM »
I'm trying to make an options menu for my game with a scrollable window.

I've followed this post and spent hours trying to get it to work but the closest I got was the buttons dragged but were not clipping and could not be pressed.  :(

Can someone give me babysteps on how to achieve this please?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Can't set up UIDraggablePanel
« Reply #1 on: June 02, 2012, 02:16:40 PM »
Assuming you have a window which has a panel on it and a background...

1. Add a child game object to your first panel, put a UIPanel on it.
2. Bring it forward (-Z transform).
3. Set up clipping properties you want to have.
4. Add children to this new panel that will be clipped.
5. Add a UIDraggablePanel script to this new panel, set it up how you want it (scale 0, 1, 0 to drag vertically for example).
6. Add a collider to the background sprite (that's a child of your original first panel).
7. Add a UIDragPanel script to the same sprite.
8. Reference your UIDraggablePanel on your UIDragPanel script from step 7.

That's it.

derkoi

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 57
    • View Profile
Re: Can't set up UIDraggablePanel
« Reply #2 on: June 03, 2012, 03:50:12 AM »
Thanks!!

deathmtn

  • Guest
Re: Can't set up UIDraggablePanel
« Reply #3 on: June 07, 2012, 12:56:35 PM »
I'm having a similar problem (nothing actually scrolls) using the latest trial version. I don't understand what you mean by:
Quote
7. Add a UIDragPanel script to the same sprite.
In both the documentation and the package's assets, I can't find a UIDragPanel. There's just UIDraggablePanel and UIDragPanelContents. Can you clarify this?

Skared Creations

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
    • Skared Creations
Re: Can't set up UIDraggablePanel
« Reply #4 on: June 07, 2012, 01:00:15 PM »
I'm having a similar problem (nothing actually scrolls) using the latest trial version. I don't understand what you mean by:In both the documentation and the package's assets, I can't find a UIDragPanel. There's just UIDraggablePanel and UIDragPanelContents. Can you clarify this?
He meant UIDraggablePanel
Skared Creations
Game Development Studio
http://skaredcreations.com

deathmtn

  • Guest
Re: Can't set up UIDraggablePanel
« Reply #5 on: June 07, 2012, 01:07:07 PM »
Ah, yes. Just tried it - it works. Thanks!

It seemed counterintuitive to me that UIDragPanelContents would go on the background object, which is not actually the "contents", but looking at the code, it looks as though UIDragPanelContents is more of a trigger for dragging rather than the contents being dragged.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Can't set up UIDraggablePanel
« Reply #6 on: June 07, 2012, 03:21:41 PM »
It's an action -- it will drag the panel's contents. :)