Sign in to follow this  
mariogarranz

Object has no method 'preUpdate' when scaling the game

Recommended Posts

I'm getting this error when my game is scaled in 1.2:
 
  1. Uncaught TypeError: Object [object Object] has no method 'preUpdate' phaser.js:25634
    1. Phaser.Stage.preUpdatephaser.js:25634
    2. Phaser.Game.updatephaser.js:28900
    3. Phaser.RequestAnimationFrame.updateRAFphaser.js:43151
    4. _onLoop
 
 
The error doesn't appear when playing without any kind of scaling.
 
The function causing the error is this one:
Phaser.Stage.prototype.preUpdate = function () {        this.currentRenderOrderID = 0;    //  This can't loop in reverse, we need the orderID to be in sequence    var len = this.children.length;    for (var i = 0; i < len; i++)    {        this.children[i].preUpdate();    }}

And this is how I am scaling the game:

 

 

this.game.scale.scaleMode = Phaser.ScaleManager.EXACT_FIT;this.game.scale.setShowAll();this.game.scale.refresh();

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.