From ec68d9c187e964a775019b0de1844297054a8b21 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Sun, 15 Jun 2014 19:33:58 -0700 Subject: [PATCH] Size wordbubbles to text --- moonlight/js/moonlight-skulk.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index 0a13abf..4af9442 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -845,9 +845,11 @@ var AISprite = function(game, x, y, key, frame) { this.snap_bubble_position = function() { this.bubble_sprite.x = this.x + 16; - this.bubble_sprite.y = this.y - 33; - this.bubble_text.position.x = this.bubble_sprite.x + 8; - this.bubble_text.position.y = this.bubble_sprite.y + 8; + this.bubble_sprite.y = this.y; + var tx = this.bubble_sprite.x + 8 - (this.text_size[0]/2); + var ty = this.bubble_sprite.y + 8 - (this.text_size[1]/2); + this.bubble_text.position.x = tx; + this.bubble_text.position.y = ty; } this.update = function()