Jump to content

Container problem with bitmapped text


pinkpanther
 Share

Recommended Posts

Hi,

 

this is the code:

 

Score = game.Class.extend({
            init : function() {
                this.container = new game.Container();
                this.container.position.x = 0;
                this.container.position.y = 4 * game.system.height / 5;
                this.img = new game.Sprite('hit', 0, 0, {
                    anchor : {
                      x : 0.5,
                      y : 0.5,
                    }
                });
                this.img.position.x = game.system.width / 2 - this.img.width / 2;
                this.img.position.y = 140;
                this.textBox = new ScoreText('0', 0, 0, 1);
                this.container.addChild(this.textBox);
                this.container.addChild(this.img);               
                game.scene.stage.addChild(this.container);
            },
        });

 

This gives me following errors:

 

TypeError: child.setStageReference is not a function

 

TypeError: this.children.updateTransform is not a function

 

this.children.updateTransform();

(repeatedly)

 

What have I done wrong?

 

Regards!

      

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