From 29760a5e7413c378baa2367082426398ca05b134 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Sat, 14 Jun 2014 20:39:03 -0700 Subject: [PATCH] Light meter --- moonlight/js/moonlight-skulk.js | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index 647db50..7c40b12 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -284,8 +284,12 @@ var moonlightSettings = { ], 'images': [ { - 'name': 'simplelight', - 'path': 'gfx/lights/light-white-256px.png' + 'name': 'lightbox.png', + 'path': 'gfx/ui/lightbox.png' + }, + { + 'name': 'lightbar.png', + 'path': 'gfx/ui/lightbar.png' }, { 'name': 'wordbubble', @@ -906,13 +910,6 @@ GameState.prototype.create = function() this.camera.follow(player, Phaser.Camera.FOLLOW_TOPDOWN); controls = game.input.keyboard.createCursorKeys(); - this.game.time.advancedTiming = true; - this.fpsText = this.game.add.text( - 20, 20, '', { font: '16px Arial', fill: '#ffffff' } - ); - this.fpsText.fixedToCamera = true; - - this.shadowTexture = game.add.bitmapData(game.world.width, game.world.height); // drop this lower to make the map darker this.shadowTextureColor = 'rgb(60, 60, 60)'; @@ -931,6 +928,23 @@ GameState.prototype.create = function() this.staticSounds.forEach(function(snd) { snd.update_new_values(); }, this) + + this.uigroup = game.add.group(); + this.game.time.advancedTiming = true; + this.fpsText = this.game.add.text( + 20, 20, '', { font: '16px Arial', fill: '#ffffff' }, this.uigroup + ); + this.lightbox = this.game.add.image(game.camera.width / 2 - 50, + game.camera.height - 40, + 'lightbox', + 0, + this.uigroup); + this.lightbar = this.game.add.image(this.lightbox.x + 3, + this.lightbox.y + 3, + 'lightbar', + 0, + this.uigroup); + this.uigroup.setAll('fixedToCamera', true); } GameState.prototype.updateShadowTexture = function() {