Jump to content

DOM Element Issue - DIv container positioned offscreen - Chromium Browers - Phaser 3 - 3.55


amurdoch22
 Share

Recommended Posts

Good Day

I configured my game for DOM Elements, and the div container that's getting placed is under my canvas, instead of on top of the canvas, only on Chromium based browsers, on Firefox the div is set on top correctly.

Example: (Chromium):
image.thumb.png.483419df3acdc6d1bf57d43c8645c72b.png

 

Firefox:

image.png.a073dd5c04ec9a862c2e577d36a97062.png

 

I found on Chromium - Linux, I can target the overlap with the following selector, but is there a better way to go about this?

body > div:nth-child(12) {
  position: absolute;
  top: 0;
  left: 0;
}

This is my game config:

this.config = {
  type: Phaser.AUTO,
  dom: {
    createContainer: true,
    behindCanvas: true
  },
  scale: {
    mode: Phaser.Scale.FIT,
  },
  height: 940,
  width: 1840,
  scene: [ StartScene,
           IdentificationScene,
           MainScene,
           FinalScene ],
  parent: "gameContainer",
};

Has anyone seen this behavior before?  I'm using Angular 12 with the framework. Is there a better selector that won't require a child selector?

Thanks

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.

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...
 Share

  • Recently Browsing   0 members

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