diff --git a/moonlight/gfx/ui/font-16px.png b/moonlight/gfx/ui/font-16px.png new file mode 100644 index 0000000..1c8a174 Binary files /dev/null and b/moonlight/gfx/ui/font-16px.png differ diff --git a/moonlight/gfx/ui/font-32px.png b/moonlight/gfx/ui/font-32px.png new file mode 100644 index 0000000..cbde88e Binary files /dev/null and b/moonlight/gfx/ui/font-32px.png differ diff --git a/moonlight/gfx/ui/font-8px.png b/moonlight/gfx/ui/font-8px.png new file mode 100644 index 0000000..2941a92 Binary files /dev/null and b/moonlight/gfx/ui/font-8px.png differ diff --git a/moonlight/src/Constants.js b/moonlight/src/Constants.js index e9cc552..d7c3722 100644 --- a/moonlight/src/Constants.js +++ b/moonlight/src/Constants.js @@ -4,6 +4,10 @@ SCREEN_HEIGHT = 480; SCREEN_OFFSET_RECENTLYSTOLEN = new Phaser.Point(240, SCREEN_HEIGHT - 32); RECENTLYSTOLEN_MAX = 5; +FONTSIZE_SMALL = 8; +FONTSIZE_MEDIUM = 16; +FONTSIZE_LARGE = 32; + SPEED_WALKING = 8; SPEED_RUNNING = 14; diff --git a/moonlight/src/GameStates.js b/moonlight/src/GameStates.js index 948e39e..2b93668 100644 --- a/moonlight/src/GameStates.js +++ b/moonlight/src/GameStates.js @@ -572,20 +572,36 @@ var StartScreen = function(game) { StartScreen.prototype.create = function() { - this.startGameButton = game.add.button((640 / 2) - (224/2), - 100, - 'newgamebtn', - this.startGameClicked, - this, - 1, - 0); - this.creditsButton = game.add.button((640 / 2) - (182/2), - 200, - 'creditsbtn', - this.creditsClicked, - this, - 1, - 0); + this.labeltext = bitmapText("(C) 2014 Andrew Kesterson - http://akesterson.itch.io/", + FONTSIZE_SMALL); + this.linkButton = game.add.button(game.world.centerX, + 460, + this.labeltext, + this.linkClicked, + this); + this.linkButton.anchor.setTo(0.5, 0.5); + + this.startGameButton = game.add.button(game.world.centerX, + 100, + 'newgamebtn', + this.startGameClicked, + this, + 1, + 0); + this.startGameButton.anchor.setTo(0.5, 0.5); + this.creditsButton = game.add.button(game.world.centerX, + 200, + 'creditsbtn', + this.creditsClicked, + this, + 1, + 0); + this.creditsButton.anchor.setTo(0.5, 0.5); +} + +StartScreen.prototype.linkClicked = function() +{ + window.open("http://akesterson.itch.io/"); } StartScreen.prototype.startGameClicked = function() diff --git a/moonlight/src/Settings.js b/moonlight/src/Settings.js index 28f1cf7..e3afab7 100644 --- a/moonlight/src/Settings.js +++ b/moonlight/src/Settings.js @@ -147,6 +147,18 @@ var moonlightSettings = { } ], 'images': [ + { + 'name': 'font-32px', + 'path': 'gfx/ui/font-32px.png' + }, + { + 'name': 'font-16px', + 'path': 'gfx/ui/font-16px.png' + }, + { + 'name': 'font-8px', + 'path': 'gfx/ui/font-8px.png' + }, { 'name': 'gameover', 'path': 'gfx/ui/gameover.png' diff --git a/moonlight/src/Util.js b/moonlight/src/Util.js index 4bbe9ed..6faacd8 100644 --- a/moonlight/src/Util.js +++ b/moonlight/src/Util.js @@ -478,3 +478,22 @@ function setConversation(obj1, obj2) finisher.clearWordBubble(false); starter.enableWordBubble(); } + +function textImage(x, y, str, size, align) +{ + var text = bitmapText(str, size, align); + return game.add.image(x, y, text); +} + +function bitmapText(str, size, align) +{ + size = ( typeof size == 'undefined' ? FONTSIZE_SMALL : size); + align = ( typeof align == 'undefined' ? Phaser.RetroFont.ALIGN_LEFT : align ); + var textobj = game.add.retroFont('font-' + size + 'px', + size, + size * 2, + Phaser.RetroFont.TEXT_SET1, + 16); + textobj.setText(str, true, 0, 0, align, true); + return textobj; +}