Jump to content

RenderTexture failing due to no default renderer in PIXI


XekeDeath
 Share

Recommended Posts

I have just downloaded the latest 1.2, and have a problem with a PIXI.RenderTexture.

 

This worked in the version I had last week (which I dont have a commit number for or anything).

I am building on the Base Template, so I have a Boot state, a Preloader state, and my Game state.

When I click the button to move from the preloader to the game, I get an error in the console that the renderer of the RenderTexture object is not defined.

 

I stepped through the process in the debugger and found that here:

/** * @method Phaser.StateManager#loadComplete * @protected */loadComplete: function () {        if (this._created === false && this.onCreateCallback)        {            this._created = true;            this.onCreateCallback.call(this.callbackContext, this.game);        }        else        {            this._created = true;        }    },

the PIXI.defaultRenderer object is set to the canvas renderer object as expected, but as soon as the code steps into the callback, the defaultRenderer is undefined.

EDIT: PIXI itself is undefined inside my state, not just the default renderer variable.

 

In this case, the callback being called in the create function of my Game state, where I create a RenderTexture object.

Link to comment
Share on other sites

Okay got this sorted out.

I see that we now have Phaser.RenderTexture, and I remembered that comment about groups being DisplayObjectContainers, so I got past all the errors here by replacing the PIXI objects with Phaser objects as needed.

 

Haven't confirmed that it is fully working as it was before, because now I have a new problem.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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