fariazz

Scene restarting not resetting camera FX

Recommended Posts

I was wondering if it's expected behavior that camera effects are not reset when a scene is restarted.

The following code will fade out, and the screen will remain black after the scene is restarted:

gameScene.create = function() {

  // create a sprite
  let bg = this.add.sprite(100, 100, 'treasure');

  // fade out
  this.cameras.main.fade(1000);

  // restart the scene
  this.time.delayedCall(2000, function() {
    this.scene.restart();
  }, [], this);

 

What I'm adding at the moment is `this.cameras.main.resetFX();` when initiating a scene in order to have the view back, but it kind of feels like the camera subsystem should refresh as well when using `this.scene.restart()`.

Share this post


Link to post
Share on other sites

I also noticed this and I think some detailed clarity on what should be retained when a scene is restarted or a new one started is necessary. This currently works counter to the way I think it should, but just having some more understanding and clarity of what to expect when a scene starts would probably clear up a majority of my issues I'm considering opening up bugs for.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.