From 3970b70c50189a1d4778f0a48fa9da8e93fe8a1c Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Sun, 15 Jun 2014 20:19:16 -0700 Subject: [PATCH] Size wordbubbles to text --- moonlight/gfx/map.json | 2 -- moonlight/js/moonlight-skulk.js | 9 +-------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/moonlight/gfx/map.json b/moonlight/gfx/map.json index fa3bf1b..7a4dc6a 100644 --- a/moonlight/gfx/map.json +++ b/moonlight/gfx/map.json @@ -285,7 +285,6 @@ "name":"BigTopCustomer2", "properties": { - "sprite_canmove":"false", "sprite_group":"townsfolk-female", "sprite_name":"townsfolk-female-2" }, @@ -301,7 +300,6 @@ "name":"BigTopCustomer2", "properties": { - "sprite_canmove":"false", "sprite_group":"townsfolk-male", "sprite_name":"townsfolk-male-3" }, diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index dc33cd6..4fcd4c0 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -567,7 +567,6 @@ var moonlightDialog = { }, "townsfolk-guard" : { "unaware" : [ - "This is some\nmultiline text\nin this bitch", "Just doing my civic duty.", "Good day, citizens.", "Honor. Liberty. Justice.\nOh, and pancakes…\nI love pancakes.", @@ -827,18 +826,13 @@ var AISprite = function(game, x, y, key, frame) { var mylines = moonlightDialog['status'][this.sprite_group][aistate]; bubbleimg = game.cache.getImage('wordbubble'); - //text = mylines[game.rnd.integerInRange(0, mylines.length-1)]; - text = mylines[0]; - console.log(text); + text = mylines[game.rnd.integerInRange(0, mylines.length-1)]; style = {font: '14px Arial Bold', fill: '#ffffff'} 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); - console.log(this.bubble_sprite); this.bubble_text = game.add.text(this.x, this.y, text, style); this.snap_bubble_position(); @@ -915,7 +909,6 @@ var AISprite = function(game, x, y, key, frame) { } this.update_new_values = function() { - console.log(this); if ( this.timer !== null ) this.timer.stop(); this.animations.destroy();