Jump to content

Blank Page on (Some) Android Devices When Using Scenes


Recommended Posts

I created a simple app quiz app using phaser3 and cordova, throughout development and testing (using cordova android emulator, browser, my phone, and other phones) I never had any issues with scenes. But once I deployed it, a number of people complained about having blank screens, I tried running it on bluestacks android emulator and had the same issue. I couldn't figure out why it was happening so I started rearranging and rewriting the code, and I realized whenever I load scene like the code below, I get the issue. It doesn't matter if I declared the scene in the same file or load it from an external file.

scene: [preload,about,mainmenu]

But if create a preload function and create the content of my "about" scene in a create function and add scene like below, it works fine

scene: {
            preload: preload,
            create: create

Does anyone know why this is happening or what's causing it, I don't get how it works fine on some phones and not on others. Even when I uploaded the phaser app to a web server, the phones that had the issue still had it when they accessed it via a browser, so i don't think its a cordova issue.  Any help, tip, hint, advice will be most appreciated, thanks.

P.s I have a whole bunch of scenes, which is I why am not eager to convert them all into functions like i did the 'about' scene.

Link to comment
Share on other sites

So I figure out what was wrong, I started by creating scenes as shown here instead of as objects.  Problem still existed, so I continued messing with the code till I found the real issue, it was the way I was handling mouse input event. This is how I was handling it

this.btn.on('pointerdown', () => {//some code});

For some reason this caused errors on a lot of devices, I can't remember how I came about using this approach in the first place, is it wrong? Once I changed it to the below, app was running on all devices.

this.btn.on('pointerdown', function (event) {//some code}, this);

Anyone knows why this happened?

Edited by MZuex
Link to comment
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.

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.


  • Recently Browsing   0 members

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