Home

Awesome

Phaser scrollable component

This component can simulate vertical and horizontal scrolling to a Phaser.Group.

This component is directly derived from jdnichollsc's amazing work on his plugin, Kinetic Scrolling Plugin. I converted it to use groups instead of moving the camera, added support for multiple scrollers, and some bug fixes.

Download the Component

Install using npm:

npm install https://github.com/trueicecold/phaser-scrollable --save

Using the Component

	this.scroller = game.add.existing(new ScrollableArea(x, y, w, h, params));
    var textStyle = {font:"30px Arial", fill:"#ffff00"};
	for (var i=0;i<10;i++) {
		for (var j=0;j<80;j++) {
			var text = game.make.text(i*330, j*30, "Yes, everything scrolls", textStyle);
			scroller.addChild(text);
		}
	}
	scroller.start();

Change the component parameters at runtime

	scroller.configure(params);

Methods

Demo

https://cdn.rawgit.com/trueicecold/phaser-scrollable/e2bfe0cd/scrollable-kinetic.html

Made with <3 for <img src="https://phaser.io/images/logo/logo-download.png" width="80" height="80"/>