Jump to content

Screen fade to black


oxysoft
 Share

Recommended Posts

Much to my surprise, I could not find the answer to this question anywhere. Is it possible to fade the whole screen to black (with a tween if possible) without the use of a custom filter? And if I do need to use a fragment shader, will I be able to tween it like any other variable?

 

Thanks

Link to comment
Share on other sites

  • 1 year later...

Fade from black when you start state (oncreate)

 this.camera.flash('#000000');

Fade to black from state:

startGame: function (pointer) {
	this.music.stop();
        this.camera.fade('#000000');
        this.camera.onFadeComplete.add(this.fadeComplete,this);
	},
    
    fadeComplete: function () {
		this.state.start('Game'); 
	}

Make sure you have the latest version of phaser.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...