Size wordbubbles to text

This commit is contained in:
2014-06-15 20:15:31 -07:00
parent e33b6755e5
commit edc8497329

View File

@@ -833,6 +833,7 @@ var AISprite = function(game, x, y, key, frame) {
this.text_size = stringSize(text, style['font']);
this.bubble_sprite = game.add.sprite(this.x, this.y, 'wordbubble');
this.bubble_sprite.anchor.setTo(0.5, 1.0);
console.log(this.text_size);
console.log(this.bubble_sprite.scale);
this.bubble_sprite.scale.x = Number((this.text_size[0] + 16) / bubbleimg.width);
this.bubble_sprite.scale.y = Number((this.text_size[1] + 16) / bubbleimg.height);