Phaser.Plugin.KineticScrolling

new KineticScrolling(game, parent)

Kinetic Scrolling is a Phaser plugin that allows vertical and horizontal scrolling with kinetic motion. It works with the Phaser.Camera

Parameters:

Name

Type

Description

game

Object

The Game object is the instance of the game, where the magic happens.

parent

Any

The object that owns this plugin, usually Phaser.PluginManager.

Source - out/plugins/KineticScrolling/KineticScrolling.js, line 21

Methods

beginMove()

Event triggered when a pointer is pressed down, resets the value of variables.

Source - out/plugins/KineticScrolling/KineticScrolling.js, line 107

configure(options)

Change Default Settings of the plugin

Parameters:

Name

Type

Argument

Description

options

Object

<optional>

Object that contain properties to change the behavior of the plugin.

Properties

Name

Type

Argument

Default

Description

timeConstantScroll

number

<optional>

325

The rate of deceleration for the scrolling.

kineticMovement

boolean

<optional>

true

Enable or Disable the kinematic motion.

horizontalScroll

boolean

<optional>

true

Enable or Disable the horizontal scrolling.

verticalScroll

boolean

<optional>

false

Enable or Disable the vertical scrolling.

horizontalWheel

boolean

<optional>

true

Enable or Disable the horizontal scrolling with mouse wheel.

verticalWheel

boolean

<optional>

false

Enable or Disable the vertical scrolling with mouse wheel.

deltaWheel

number

<optional>

40

Delta increment of the mouse wheel.

Source - out/plugins/KineticScrolling/KineticScrolling.js, line 63

endMove()

Event triggered when a pointer is released, calculates the automatic scrolling.

Source - out/plugins/KineticScrolling/KineticScrolling.js, line 151

mouseWheel()

Event called when the mousewheel is used, affect the direction of scrolling.

Source - out/plugins/KineticScrolling/KineticScrolling.js, line 223

moveCamera()

Event triggered when the activePointer receives a DOM move event such as a mousemove or touchmove. The camera moves according to the movement of the pointer, calculating the velocity.

Source - out/plugins/KineticScrolling/KineticScrolling.js, line 124

start()

Start the Plugin.

Source - out/plugins/KineticScrolling/KineticScrolling.js, line 88

update()

Event called after all the core subsystems and the State have updated, but before the render. Create the deceleration effect.

Source - out/plugins/KineticScrolling/KineticScrolling.js, line 179