Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this.scale.setGameSize(window.width, window.height) throwing error #5525

Closed
rattias opened this issue Jan 24, 2021 · 2 comments
Closed

this.scale.setGameSize(window.width, window.height) throwing error #5525

rattias opened this issue Jan 24, 2021 · 2 comments

Comments

@rattias
Copy link

rattias commented Jan 24, 2021

Version

  • Phaser Version: 3.52.0
  • Operating system: Linux 5.4.0-58-generic Event for while dragging #64-Ubuntu SMP
  • Browser: 1.0.4044.129 (Official Build) (64-bit)

Description

The scene.scale.setGameSize() method results in an error with the following stack trace:

Uncaught Error: Framebuffer status: Incomplete Attachment
    at WebGLRenderer.createFramebuffer (phaser.js:81326)
    at RenderTarget.resize (phaser.js:35261)
    at WebGLRenderer.emit (phaser.js:1928)
    at WebGLRenderer.resize (phaser.js:80268)
    at WebGLRenderer.onResize (phaser.js:80191)
    at ScaleManager.emit (phaser.js:1935)
    at ScaleManager.refresh (phaser.js:96561)
    at ScaleManager.setGameSize (phaser.js:96397)
    at Game.create (main.js:12)
    at SceneManager.create (phaser.js:98721)

Example Test Code

import Phaser from './lib/phaser.js'

class Game extends Phaser.Scene {
  constructor () {
    super('game')
  }

  preload () { }

  create () {
    this.scale.setGameSize(window.width, window.height)
  }

  update (time, delta) { }
}

export default new Phaser.Game({
  type: Phaser.AUTO,
  scale: {
    parent: 'mygame',
    mode: Phaser.Scale.FIT,
    autoCenter: Phaser.Scale.CENTER_BOTH,
    width: 800,
    height: 600
  },
  audio: {
    disableWebAudio: true
  },
  dom: {
    createContainer: true
  },
  scene: [Game]
})

Additional Information

I have no reason to believe this is specific just to one browser. I also tried to move the setGameSize invocation to update(), but the same result happens.

@photonstorm
Copy link
Collaborator

This issue has been mentioned on Phaser. There might be relevant details there:

https://phaser.discourse.group/t/full-screen-scaling-and-resizing-question/8710/4

@rattias
Copy link
Author

rattias commented Jan 25, 2021

My bad. I should have pased window.innerWidth, window.innerHeight, not width and height, which are not defined.

@rattias rattias closed this as completed Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants