From 767b6dd12d3a701c3ea00eb2cf6501707e6fad3c Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Sun, 15 Jun 2014 19:25:54 -0700 Subject: [PATCH] Size wordbubbles to text --- moonlight/js/moonlight-skulk.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index 1f79784..d8556f9 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -827,6 +827,7 @@ var AISprite = function(game, x, y, key, frame) { this.text_size = stringSize(text, style['font']); bubblegrp = game.state.states.game.bubble_group; console.log(bubblegrp); + console.log(bubbleimg); this.bubble_sprite = game.add.sprite(this.x, this.y, 'wordbubble', bubblegrp); this.bubble_sprite.anchor.setTo(0.5, 1.0); this.bubble_sprite.scale(Number(this.text_size[0] / bubbleimg.width), @@ -1111,8 +1112,8 @@ GameState.prototype.create = function() this.lightbar_image = game.cache.getImage('lightbar'); this.lightbar_crop = new Phaser.Rectangle(0, 0, - game.cache.getImage('lightbar').width, - game.cache.getImage('lightbar').height); + this.lightbar_image.width, + this.lightbar_image.height); this.uigroup.setAll('fixedToCamera', true); }