Skip to content

satanas/phaser-fade-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Fade out plugin for Phaser

This plugin let you create easily a fade out effect in any state to simulate a transition. Has been developed and tested on phaser.js 2.0.

In the future it will support the fade in effect too.

Usage

The syntax of the fadeOut method is pretty simple:

fadeOut(hexColor, duration, delay, callback);

Where:

  • hexColor is a hex number representing the color of the fade (for example: 0xfff for white)
  • duration is how much time the fade will take
  • delay is the time you want to wait after the fade is done to invoke the callback
  • callback is the method invoked after the fade is completed

You don't need to add the plugin anywhere, just call it whenever you need it. For example:

this.game.plugin.fadeOut(0x000, 750, 0, function() {
  self.game.state.start('another_state');
});

About

Fade in/out plugin for Phaser.js 2.0

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published