Sam987X

Window resize/fullScreen

Recommended Posts

Hi in my game i have got it so that when i click on the screen it will toggle full screen and it works perfectly without any problems but when i go and debug my code i get these errors .Any help would be much appreciated 

Uncaught TypeError: Cannot read property 'dispatch' of undefined
    at Phaser.ScaleManager.fullScreenChange (phaser.js:37411)
    at HTMLDocument._fullScreenChange (phaser.js:36175)



WebSocket connection to 'ws://localhost:8125/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
 game.scale.fullScreenScaleMode = Phaser.ScaleManager.SHOW_ALL;
            game.input.onDown.add(gofull, this);
            function gofull() {

        if (game.scale.isFullScreen)
        {
            game.scale.stopFullScreen();
            game.state.restart();
        }
        else
        {
            game.scale.startFullScreen(false);
            game.state.restart();
        }
                this.scale.pageAlignHorizontally = true;
                this.scale.pageAlignVertically = true;

            }

.

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.