Author Topic: Example 7 Scroll View (Panel) Vertical Settings?  (Read 17169 times)

cybercloud03

  • Guest
Example 7 Scroll View (Panel) Vertical Settings?
« on: May 10, 2012, 10:53:03 PM »
I was looking at the example for a scroll view, and it mentions setting the scroll to the X or Y axis. I am trying to figure out how to switch the scroll bar to control the vertical scroll as well.

Currently the example starts with the scroll bar in a horizontal position, and using the scroll bar the items move from left to right. If I set the UIScrollBar Direction to vertical, the scrollbar shifts, but using the scrollbar still moves the item left to right.

Would I have to change each Item in the UIGrid?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Example 7 Scroll View (Panel) Vertical Settings?
« Reply #1 on: May 10, 2012, 11:11:03 PM »
Look on UIDraggablePanel. You specify which scroll bar is used there. There is one reference for a horizontal bar, and another for a vertical bar.

KlingOne

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Example 7 Scroll View (Panel) Vertical Settings?
« Reply #2 on: July 11, 2012, 05:09:09 AM »
I have a problem when changeing the scrollbar settings to vertical as you mentioned here.
I get the vertical scrollbar just as I want it, but when i drag the slider clipping area of the UIPanel itself gets moved instead of the items in the UIGrid itself.
This results in a behaviour where the area of items that are visible gets moved down which is not what I want.
I want the same behaviour as the horizontal scroll view (moving the items rather than the clipping area) just vertical.
Am I doing something wrong?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Example 7 Scroll View (Panel) Vertical Settings?
« Reply #3 on: July 11, 2012, 05:13:14 AM »
"The area of items" -- meaning you have a background in there? Move it out. Only the items should be in the clipped area.

This is how draggable panel script works -- it adjusts the clipping, resulting in a far better performance than moving widgets.

KlingOne

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Example 7 Scroll View (Panel) Vertical Settings?
« Reply #4 on: July 11, 2012, 05:50:19 AM »
Thx for the fast reply.
But no there is no background what I meant was the clipping area itself.
I'm just using the example 7 scene with the changes you described in your previous post.

"This is how draggable panel script works -- it adjusts the clipping, resulting in a far better performance than moving widgets."
But in the unmodified example 7 scene the widgets themselves get moved (The orange area in the scene view that contains the items).
When I change everything to vertical the clipping area gets moved (the pink area in the scene view).
To clarify what i mean i took a screenshot: http://imgur.com/jFX9U
What I want is to also move the "orange area" in vertical mode. But instead of moving it vertically I want to move it horizontally.

KlingOne

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Example 7 Scroll View (Panel) Vertical Settings?
« Reply #5 on: July 11, 2012, 06:41:50 AM »
OK I found out what the difference between horizontal and vertical is.
If scrolled horizontally the transform of the UIPanel gets translated into the opposite direction of the clipping area thus making the clipping area appear to remain in the same place.
This has the desired effect of seeing the items in the UIGrid move under a (seemingly) stationary clipping area.
If scrolled vertically however the transform of the UIPanel does not get translated accordingly thus the clipping area itself can be seen moving which results in an undesirable effect.
Is this a bug or on purpose?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Example 7 Scroll View (Panel) Vertical Settings?
« Reply #6 on: July 11, 2012, 01:42:58 PM »
It works exactly the same. Check the quest log example, it uses vertical scrolling.

dol9340

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: Example 7 Scroll View (Panel) Vertical Settings?
« Reply #7 on: September 07, 2012, 02:27:49 AM »
I have Same Problem.
Would You make some Video Tutorial about Vertical Setting?

jindave

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Example 7 Scroll View (Panel) Vertical Settings?
« Reply #8 on: May 31, 2013, 09:27:33 AM »
I have same problem, have any one solution ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Example 7 Scroll View (Panel) Vertical Settings?
« Reply #9 on: May 31, 2013, 02:04:27 PM »