Jump to content

Does Phaser have a scroll view or scrollable container?


PadreMontoya
 Share

Recommended Posts

Does Phaser offer any concept of a "Scroll View"?  Basically a box you can add content to and swipe up and down?

 

I'm trying to create scrollable list of items.  I think I can manually code a scroll view, but I just thought I'd check to see if it already exists first.

Link to comment
Share on other sites

@PadreMontoya I have a partial solution, I'm still working out the kinks on transforms and clipping masks.  Anyway what I did was create a invisible sprite which has a drag handler and a hitarea the size of the clipped scrolling area that forwards movement/timing info to the zinga scroller really any scroller would work but theirs was simple to integrate.

 

The drag helper sprite and calls into the zynga scroller is in this gist, the full code relies on a couple other files so it isn't a finished solution for you but might help some.

 

http://goo.gl/MsS8Ah

 

https://github.com/zynga/scroller

 

-bpt

Link to comment
Share on other sites

  • 10 months later...
  • 1 month later...
  • 2 weeks later...

Just want to bump this..

​The Zynga Scroller isn't easily ported.. just spent some time trying to get it, and couldn't get it to properly scroll, without it going exponentially as I click and held the scroll.

​I'm not the only one who's had a problem, as a tutorial linked from phaser on a scrolling list, also mentions issues with the zynga scroller.  ( http://yusyuslabs.com/tutorial-momentum-scrolling-inside-scrollable-area-with-phaser-js/ )

​And their tutorial doesn't work well either, it's super choppy and has the exponential scrolling speed issue.

​I'm shocked there isn't a better tutorial on this, as it seems most games have a scrollable inventory/market list.. any help would be appreciated.

​Also, Nicholss "Phaser-Kinetic-Scrolling-Plugin" only works on the entire world camera.  He doesn't have any examples of doing it just on a Display Container / Sprite..

Link to comment
Share on other sites

  • 6 months later...
  • 8 months later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...