# Transitions between scene

**URL:** <https://phaser.discourse.group/t/transitions-between-scene/12753>\
**Category:** Phaser 3\
**Created:** [January 9, 2023, 1:46pm UTC](https://phaser.discourse.group/t/transitions-between-scene/12753 "2023-01-09T13:46:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nish\_mishra](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@nish\_mishra](https://phaser.discourse.group/u/nish_mishra)\
**Post date:** [January 9, 2023, 1:46pm UTC](https://phaser.discourse.group/t/transitions-between-scene/12753/1 "2023-01-09T13:46:53Z")

</div>

Hello Everyone.

When i am switching between scenes or when the game first loads, there is a black overlay which appears for a fraction of second. I want to change the color of this transition to white(which is now black).

Tried to set the camera background color and canvas color but no luck.

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [January 9, 2023, 11:37pm UTC](https://phaser.discourse.group/t/transitions-between-scene/12753/2 "2023-01-09T23:37:23Z")

</div>

```
new Phaser.Game({ backgroundColor: 0xffffff })

```

should do that.

---

<div class="post-metadata">

**Author:** ![nish\_mishra](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@nish\_mishra](https://phaser.discourse.group/u/nish_mishra)\
**Post date:** [January 10, 2023, 5:27am UTC](https://phaser.discourse.group/t/transitions-between-scene/12753/3 "2023-01-10T05:27:36Z")

</div>

> [@samme](#):
>
> `0xffffff`

Hey Samme,  
Already tried that, not working.

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [January 10, 2023, 2:26pm UTC](https://phaser.discourse.group/t/transitions-between-scene/12753/4 "2023-01-10T14:26:58Z")

</div>

What does it look like?

---

<div class="post-metadata">

**Author:** ![nish\_mishra](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@nish\_mishra](https://phaser.discourse.group/u/nish_mishra)\
**Post date:** [January 11, 2023, 8:12am UTC](https://phaser.discourse.group/t/transitions-between-scene/12753/5 "2023-01-11T08:12:53Z")

</div>

Hey @samme

[https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/6/6e09329d8b2ebb3fe5c71cbaeda0624d6518e39b.mp4](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/6/6e09329d8b2ebb3fe5c71cbaeda0624d6518e39b.mp4)
  
checkout this Video, once the game reloads a black screen appears, also between the scene transitions there is a flicker too.

here is the config

```javascript
let game = new Phaser.Game({
    type: Phaser.WEBGL,
    backgroundColor: 0xffffff,
    transparent: true,
    scene: [PreloaderView, MenuView, GamePlayView],
    parent: 'game-div',
    scale: {
        width: 1920,
        height: 1080,
        mode:Phaser.Scale.FIT,
        autoCenter: Phaser.Scale.Center.CENTER_BOTH
    }
})

```

and this is how my index.html looks like.

```javascript
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>Game Name</title>

    <meta name="viewport" content="initial-scale=1, width=device-width, user-scalable=no" />

    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="mobile-web-app-capable" content="yes">

    <link rel="icon" type="image/png" href="assets/favicon.png" />

    <style>
        body {
            overflow: hidden;
            background-color: #ffffff;
            height: 100%;
            width: 100%;
            padding: 0;
            margin: 0;
        }

        #game-div {
            background-color: #ffffff;
        }

        @font-face {
            font-family: "Roboto";
            src: url('../packet/media/fonts/Roboto-Regular.ttf');
            font-weight: 400;
            font-weight: normal;
        }

        @font-face {
            font-family: "Roboto Bold";
            src: url('../packet/media/fonts/Roboto-Bold.ttf');
        }

        @font-face {
            font-family: "Roboto Black";
            src: url('../packet/media/fonts/Roboto-Black.ttf');
        }

        @font-face {
            font-family: "Roboto Italic";
            src: url('../packet/media/fonts/Roboto-BoldItalic.ttf');
        }

        @font-face {
            font-family: "Roboto Medium";
            src: url('../packet/media/fonts/Roboto-Medium.ttf');
        }
    </style>

</head>

<body
    style="-moz-user-select: none; -webkit-user-select: none; -ms-user-select:none; user-select:none;-o-user-select:none;"
    unselectable="on" onselectstart="return false;" onmousedown="return false;">
    <div style="font-family:Roboto; position:absolute; left:-1000px; visibility:hidden;">.</div>
    <div style="font-family:Roboto Bold; position:absolute; left:-1000px; visibility:hidden;">.</div>
    <div style="font-family:Roboto Black; position:absolute; left:-1000px; visibility:hidden;">.</div>
    <div style="font-family:Roboto Italic; position:absolute; left:-1000px; visibility:hidden;">.</div>
    <div style="font-family:Roboto Medium; position:absolute; left:-1000px; visibility:hidden;">.</div>
</body>
<div id="game-div"></div>

</html>

```

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [January 11, 2023, 3:16pm UTC](https://phaser.discourse.group/t/transitions-between-scene/12753/6 "2023-01-11T15:16:33Z")

</div>

If you have `transparent: true` then `backgroundColor` is ignored, but that may not matter.

What do you have in the scenes?

---

<div class="post-metadata">

**Author:** ![nish\_mishra](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@nish\_mishra](https://phaser.discourse.group/u/nish_mishra)\
**Post date:** [January 12, 2023, 6:31am UTC](https://phaser.discourse.group/t/transitions-between-scene/12753/7 "2023-01-12T06:31:03Z")

</div>

Hi @samme  
I figures it out.  
So i have the base scene which inherits Phaser.Scene and all the other scenes in my game inherits the base scene.  
i mistakenly added // this.cameras.main.fadeIn(300, 0, 0, 0) in base scene’s create.

Removed it and everything seems to be working great.

My bad, thanks for your time.
