Phaser state transition plugin
npm install phaser-state-transitionState Transition Plugin for Phaser
=======================

game.world into a renderTexture which is rendered on a sprite, and finally it's tweening that sprite.
https://codepen.io/cristianbote/full/GjgVxg
``bash`
npm install phaser-state-transition --save
And then import it in your project
`js`
import "phaser-state-transition";
The plugin needs the Phaser framework to work, therefore you should make sure that this is included before the plugin's import.
#### Straight but nor recommended
Just download the dist/phaser-state-transition.umd.js file and you're done, but this is not the recommended way. You should use it via npm. You have better control on what version you're keeping locally.
`js
import { createTransition } from "phaser-state-transition";
const EnteringTransition = createTransition({
props: {
x: game => game.width
}
});
game.state.start("stateName", EnteringTransition);
`
The transition options to pass in are basically just some instructions for the plugin, to handle the _how_ of the transition. You'll find there are other properties inside, like ease, duration and other properties that are not that important to have nice transitions.
method.The default duration would be
500ms and the ease function Phaser.Easing.Exponential.InOut*
@param {object} options The options to create a transition object
* @returns {object} The transition object to be passed along the game.start.state`