Author Topic: Scroll View - Momentum and Spring question  (Read 3564 times)

_joe_

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Scroll View - Momentum and Spring question
« on: December 03, 2012, 09:15:48 AM »
Hello,
I'm currently implementing a Level selection Panel following Example 7, Scroll View (Panel).
My Elements are spread apart, and not as close as the example (0 , 1000, 2000,3000,...).
I also have Center on Items ticked, so it snaps to the "current" Element.
For it to function more naturally, i had to boost the Momentum up to 130, this works perfectly, but raised a small problem, when the panel moves to the second element, right before it ends (slows down), it "Snaps" into place, making it look as if the movement is not smooth at all, i looked everywhere in the code, tried to control the spring and the strength of it with no vain.
Having the Momentum at 35 (default) works good, but now i have to swipe the whole screen for the panel to move to the next elements (not such a natural feeling).

Here's a video i took of the problem i'm having, i used my phone to capture it, so the framerate drop is not showing the effect to its fullest, but the last 2 drags are clear, I added the video on my public dropbox:
https://dl.dropbox.com/u/7752980/ngui-Momentum.mp4

Any advice would be much appreciated.

Joe
« Last Edit: December 03, 2012, 10:16:57 AM by _joe_ »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scroll View - Momentum and Spring question
« Reply #1 on: December 03, 2012, 11:16:54 AM »
Why are they spread apart so much? 1000 units seems like an awful lot...

_joe_

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: Scroll View - Momentum and Spring question
« Reply #2 on: December 03, 2012, 11:22:46 AM »
They are spread apart because in my project, they are containers for levels, so each container has 15 level buttons. and i want each container to be on a "page",
So each container is a gameobject with a UIGrid and UIPanel script on it, and each container contains 15 widgets (buttons) for each level.

I understand that i will have to work with it As Is?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scroll View - Momentum and Spring question
« Reply #3 on: December 03, 2012, 11:26:17 AM »
What I am saying is that 1000 units is an awful lot to drag through. You mention that momentum of 35 (default) works fine, but you have to move a lot -- of course you do, because it's whole 1000 units. Sounds like you should reconsider your UI design -- maybe by adding a "Next" button that would move to the next page simply by using SpringPosition.Begin (and not using a clipped panel).

_joe_

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: Scroll View - Momentum and Spring question
« Reply #4 on: December 03, 2012, 11:41:38 AM »
Well it's like the Iphone's Home page, or the Bad Piggies level selection, you have pages, each page has widgets inside of it, but my design is landscape, i believe that the user experience is nice and correct, it's just the springing that is off.

Anyways, thank you for your input, i will see what i can do.

Joe