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. |
Methods
-
beginMove()
-
Event triggered when a pointer is pressed down, resets the value of variables.
-
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.
-
endMove()
-
Event triggered when a pointer is released, calculates the automatic scrolling.
-
mouseWheel()
-
Event called when the mousewheel is used, affect the direction of scrolling.
-
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. -
start()
-
Start the Plugin.
-
stop()
-
Stop the Plugin.
-
update()
-
Event called after all the core subsystems and the State have updated, but before the render.
Create the deceleration effect.