Size wordbubbles to text

This commit is contained in:
2014-06-15 19:29:57 -07:00
parent a0928af04b
commit a4f5855ed6

View File

@@ -831,8 +831,8 @@ var AISprite = function(game, x, y, key, frame) {
this.bubble_sprite = game.add.sprite(this.x, this.y, 'wordbubble', bubblegrp); this.bubble_sprite = game.add.sprite(this.x, this.y, 'wordbubble', bubblegrp);
this.bubble_sprite.anchor.setTo(0.5, 1.0); this.bubble_sprite.anchor.setTo(0.5, 1.0);
console.log(this.bubble_sprite.scale); console.log(this.bubble_sprite.scale);
this.bubble_sprite.scale.x = Number(this.text_size[0] / bubbleimg.width); this.bubble_sprite.scale.x = this.text_size[0] + 32;
this.bubble_sprite.scale.y = Number(this.text_size[1] / bubbleimg.height); this.bubble_sprite.scale.y = this.text_size[1] + 32;
this.bubble_text = game.add.text(this.x, this.y, text, style, bubblegrp); this.bubble_text = game.add.text(this.x, this.y, text, style, bubblegrp);
this.snap_bubble_position(); this.snap_bubble_position();