Jump to content

default text object function


zcstover
 Share

Recommended Posts

i'm trying to make a Text object i can call and will build the correct bitmaptext


var Text = function(game, target, font) {
	Phaser.BitmapText.call(this, game, target.x,
        target.y - target.height /2 , font, '', 24);
	this.anchor.setTo(0.5);
	console.log(this)
}

///

//so i can do something like this


this.nameDisplay = new Text(game, this, 'font:default');

but it gave me an error that this.updateText is not a function, so i added 


Text.prototype.updateText = function() {

}

under the text function, but now it says 'Cannot read property "PhysicsBody" of undefined'

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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