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

ScaleMode in config object: Cannot read property 'resize' of null #1534

Closed
l-hemka opened this issue Jan 11, 2015 · 3 comments
Closed

ScaleMode in config object: Cannot read property 'resize' of null #1534

l-hemka opened this issue Jan 11, 2015 · 3 comments

Comments

@l-hemka
Copy link

l-hemka commented Jan 11, 2015

The following code results in a TypeError with Phaser 2.2.2:

var conf = {
    height: 960,
    scaleMode: Phaser.ScaleManager.SHOW_ALL,
    width: 640
};

var game = new Phaser.Game(conf);

http://jsfiddle.net/gwhq9bhj/

@pnstickne
Copy link
Contributor

The problem is because the ScaleManager config is being applied before a renderer has been created by the game - this.game.renderer.resize(this.width, this.height) in updateDimensions, called from scaleMode = .. in ScaleManager.parseConfig, is the failing line.

@pnstickne
Copy link
Contributor

This is due to circular and semi-circular dependencies between the ScaleManager and a few other components.

I'm working on a corrective update.

photonstorm added a commit that referenced this issue Jul 8, 2015
…ause a ScaleManager TypeError in the resize method. It now stores the scale mode locally and applies it after boot (thanks @Mickawesomesque #1534)
@photonstorm
Copy link
Collaborator

This is now fixed in the dev branch.

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

3 participants