No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Quasar + Phaser: problems in fullscreen mode in Chrome, but works in Firefox

    Help
    2
    5
    743
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rusia last edited by

      I’m creating a html5 game using Phaser 3 game engine and I want to use Vue and Quasar advantages in it.
      The problem is that in fullscreen mode Quasar doesn’t work in all major browsers except Firefox and UC Browser

      Here’s the code: https://codepen.io/rusia_/pen/JzrVpm

      Before displaying Quasar dialog I have to hide Phaser canvas with style="display: none;" and then after the dialog is closed the canvas restores.
      If you click “Go fullscreen” and then “Open Quasar” you will see a QDialog.
      All browsers display it properly, but the button “Return to Phaser” works only in Firefox (both desktop and mobile) and UC Browser (mobile). I didn’t test in Safari because I don’t have an iPhone.
      In all other browsers to make it work you have to exit fullscreen by pressing Esc or F11 (or Back button on mobile)
      I tested in all major browsers on Android and Windows (except Edge).

      What am I doing wrong? Or is it a Quasar bug or Phaser bug or browser bug or whatever?

      1 Reply Last reply Reply Quote 1
      • M
        michael123 last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • M
          michael123 last edited by

          @rusia, did you find a solution?

          Was there are reason that Quasar’s fullscreen api didn’t work?

          Given that phaser is “inside” Quasar, using Quasar’s might be better…

          R 1 Reply Last reply Reply Quote 0
          • R
            rusia @michael123 last edited by

            @michael123, Yes, I found a solution. Though I’d rather say I found a workaround not a solution. I’ll give you more details later. To be honest I already forgot how exactly I solved this))

            I didn’t say that Quasar’s fullscreen api didn’t work, it works well. I only said that in this particular case when Quasar is combined with Phaser there were some problems in major browsers except Firefox.

            When phaser is “inside” quasar in html/css terms (not javascript) there were major problems. I mean when you put <div id="phaser"></div> inside <div id="q-app"></div> so that it looks like

            <div id="q-app">
                <div id="phaser"></div>
            </div>
            

            then you have problems.

            But if you isolate them:

            <div id="phaser"></div>
            <div id="q-app"></div>
            

            then they can live together.

            I believe that generally it’s only html/css problem. Despite all my years of coding experience I still can’t grok css))

            But in terms of javascript quasar, vue and phaser co-exist perfectly. No conflicts, no problems ever.

            1 Reply Last reply Reply Quote 1
            • R
              rusia last edited by rusia

              I solved this by adding this code when putting Quasar div to foreground:

              document.getElementById('q-app')[this.phaser.scale.fullscreen.request]().then(() => {}, () => {})
              

              https://codepen.io/rusia_/full/EBEKPE

              However I noticed that in current version of Chrome that problems doesn’t exist anymore.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post