Jump to content

Error with Pixi Plugin (Panda 2)


Ninjadoodle
 Share

Recommended Posts

Hi @enpu

I'm getting an error with the Pixi plugin (everything works fine with Canvas - I'm using Engine 2.0.2).

Uncaught TypeError: Cannot read property 'addChild' of undefined
    at Container.addTo (src/plugin/pixi.js:36939)
    at Class.setupMenu (src/game/objects.js:229)
    at Class.init (main.js:100)
    at new Class (core.js:1046)
    at Class._setSceneNow (src/engine/system.js:382)
    at Class._run (src/engine/system.js:342)
    at core.js:864
    at animate (core.js:960)

It looks like it has something to do with containers.

Link to comment
Share on other sites

This is the line it's referring to ...

game.scene.bg = new game.Container().addTo(game.scene.tv);

game.scene.bg = new game.Container().addTo(game.scene.tv);

in context ...

// MENU SETUP
game.createClass('MenuSetup', {

    setupMenu: function() {
        
        // SETUP CONTAINERS
        game.scene.tv = new game.Container().addTo(game.scene.stage);
        game.scene.bg = new game.Container().addTo(game.scene.tv);
        game.scene.mg = new game.Container().addTo(game.scene.tv);
        game.scene.fg = new game.Container().addTo(game.scene.tv);
        game.scene.ui = new game.Container().addTo(game.scene.tv);
        
        // SETUP BACKGROUNDS
        game.scene.bgCircle = new game.Sprite('bgCircle.png');
        game.scene.bgCircle.position.set(160, 160);
        game.scene.bgCircle.anchor.set(game.scene.bgCircle.width/2, game.scene.bgCircle.height/2);
        game.scene.bgCircle.addTo(game.scene.bg);
        
    },

 

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