Author Topic: Scrollable panels?  (Read 7853 times)

Roots

  • Guest
Scrollable panels?
« on: April 17, 2012, 10:49:06 AM »
Hi,

Is there any support for scrollable panels? E.g. i have a fixed size panel and load it with buttons, but i want a scrollbar or something so  that i can fit more buttons in the panel? Not talking about thousands but a few dozen would be good?

And if not what is a nice alternative? Maybe somekind of paging model so the user can page through the buttons?

Thanks

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Scrollable panels?
« Reply #1 on: April 17, 2012, 11:15:09 AM »
First you buy the non-free version, then you look at the examples. :P

Scrollbar was added in 2.0.

Right now there's no paged scroll though, only free scroll.

Roots

  • Guest
Re: Scrollable panels?
« Reply #2 on: April 17, 2012, 12:20:23 PM »
Thanks, and I do own the non-free version already and couldn't see anything in that direction. Haven't upgraded to 2.0 since there was no reason to. (untill now).

ant

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: Scrollable panels?
« Reply #3 on: July 16, 2012, 01:10:43 PM »
+1 paged scroll pls

JRoch

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 140
    • View Profile
Re: Scrollable panels?
« Reply #4 on: July 16, 2012, 01:22:28 PM »
For scrollable panels:  UIDraggablePanel in conjunction with clipping.  You will need to deal with adding in masking colliders to prevent interaction with clipped content, but that's pretty easy.  You can attach scrollbars to the widgets as well if you want that behavior.

If you want panels with buttons that change the content, just code that behavior in.  The content & layout of the actual panels is so varied that trying to incorporate that kind of behavior into the NGUI base classes is likely a poor idea.  You have your option of building multiple panels that you can swap out depending upon which button is pressed, or you can use one panel and dynamically rebuild the content based upon which button is pressed.

I'm guessing you're likely trying to build all of the panels & content through the inspector, which is fine for static content, but you'll want to learn how to code up dynamic interaction with the UI components if you really want the type of more complex behaviors that you're hinting at.