PadreMontoya

Does Phaser have a scroll view or scrollable container?

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.