Sign in to follow this  
oxysoft

Screen fade to black

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.