Fix: library path
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
function AnnounceBox(x, y) {
|
||||
this.posX = x;
|
||||
this.posY = y;
|
||||
}
|
||||
|
||||
AnnounceBox.prototype.drawText = function(posX, posY, text) {
|
||||
var style = { font: "24px Arial", fill: "#fff", align: "left", boundsAlignH: "center", boundsAlignV: "middle" };
|
||||
|
||||
var textObject = game.add.text(
|
||||
posX, posY,
|
||||
text, style
|
||||
);
|
||||
textObject.anchor.set(0.5);
|
||||
textObject.stroke = "#333";
|
||||
textObject.strokeThickness = 3;
|
||||
|
||||
return textObject;
|
||||
}
|
||||
|
||||
AnnounceBox.prototype.getFontStyle = function() {
|
||||
return { font: "32px Arial", fill: "#fff" };
|
||||
}
|
||||
|
||||
AnnounceBox.prototype.drawBox = function(text) {
|
||||
this.graphics = game.add.graphics(this.posX, this.posY);
|
||||
this.graphics.alpha = 0.8;
|
||||
|
||||
this.graphics.beginFill(0x303030);
|
||||
this.graphics.lineStyle(4, 0x880000, 1);
|
||||
this.graphics.moveTo(0, -190);
|
||||
this.graphics.lineTo(game.world.width / 2, -170);
|
||||
this.graphics.lineTo(game.world.width - this.posX * 2, -190);
|
||||
this.graphics.lineTo(game.world.width - this.posX * 2, 50);
|
||||
this.graphics.lineTo(game.world.width / 2, 30);
|
||||
this.graphics.lineTo(0, 50);
|
||||
this.graphics.endFill();
|
||||
|
||||
var announceText = this.drawText(
|
||||
game.world.width / 2, this.posY - 75,
|
||||
text
|
||||
);
|
||||
announceText.addColor("#ff0000", 0);
|
||||
announceText.stroke = "#330000";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
GameOverText.prototype = Object.create(Phaser.Text.prototype);
|
||||
GameOverText.constructor = GameOverText;
|
||||
|
||||
function GameOverText() {
|
||||
Phaser.Text.call(
|
||||
this, game,
|
||||
game.world.width / 2,
|
||||
game.world.height / 2 - GameOverText.MOVE_AMOUNT_PX,
|
||||
"게임 오버",
|
||||
GameOverText.DEFAULT_TEXT_FONT
|
||||
);
|
||||
// super(game, 600, 300, "게임 오버", GameOverText.DEFAULT_TEXT_FONT);
|
||||
|
||||
this.anchor.set(0.5);
|
||||
this.inputEnabled = false;
|
||||
|
||||
var grd = this.context.createLinearGradient(0, 0, 0, this.height);
|
||||
grd.addColorStop(0, '#FFD68E');
|
||||
grd.addColorStop(1, '#B34C00');
|
||||
this.fill = grd;
|
||||
// this.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
this.stroke = '#000';
|
||||
this.strokeThickness = 10;
|
||||
|
||||
|
||||
this.alpha = 0;
|
||||
var tweenAlpha = game.add.tween(this);
|
||||
tweenAlpha.to( { alpha: 1 }, GameOverText.TWEEN_ALPHA_TIME, Phaser.Easing.Linear.None, true);
|
||||
|
||||
var tweenMove = game.add.tween(this);
|
||||
tweenMove.to( { y: game.world.height / 2 }, GameOverText.TWEEN_MOVE_TIME, Phaser.Easing.Bounce.Out, true);
|
||||
|
||||
game.add.existing(this);
|
||||
};
|
||||
|
||||
|
||||
GameOverText.DEFAULT_TEXT_FONT = {
|
||||
font: "bold 100px Arial",
|
||||
boundsAlignH: "center", // left, center. right
|
||||
boundsAlignV: "middle", // top, middle, bottom
|
||||
fill: "#fff"
|
||||
};
|
||||
|
||||
GameOverText.MOVE_AMOUNT_PX = 200;
|
||||
GameOverText.TWEEN_ALPHA_TIME = 1000;
|
||||
GameOverText.TWEEN_MOVE_TIME = 1500;
|
||||
@@ -0,0 +1,21 @@
|
||||
function HowToPlay(x, y) {
|
||||
this.howToPlayText = game.add.text(
|
||||
game.world.centerX, game.world.centerY - HowToPlay.TEXT_OFFSET_X,
|
||||
"", this.getFontStyle()
|
||||
);
|
||||
this.howToPlayText.anchor.set(0.5);
|
||||
this.howToPlayText.stroke = "#333";
|
||||
this.howToPlayText.strokeThickness = 3;
|
||||
this.howToPlayText.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
}
|
||||
|
||||
HowToPlay.prototype.printHowToPlay = function(text) {
|
||||
this.howToPlayText.text = text;
|
||||
}
|
||||
|
||||
HowToPlay.prototype.getFontStyle = function() {
|
||||
return { font: "32px Arial", fill: "#fff" };
|
||||
}
|
||||
|
||||
|
||||
HowToPlay.TEXT_OFFSET_X = 200;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
||||
function ScoreBoard() {
|
||||
var fontStyle = ScoreBoard.DEFAULT_TEXT_FONT;
|
||||
|
||||
fontStyle.align = "right";
|
||||
fontStyle.boundsAlignH = "right";
|
||||
this.label = game.add.text(0, 0, "점수 : ", fontStyle)
|
||||
.setTextBounds(0, 0, game.world.width / 2, ScoreBoard.FONT_HEIGHT_PX);
|
||||
|
||||
fontStyle.align = "left";
|
||||
fontStyle.boundsAlignH = "left";
|
||||
this.scoreText = game.add.text(game.world.width / 2, 0, "0", fontStyle)
|
||||
.setTextBounds(0, 0, game.world.width / 2, ScoreBoard.FONT_HEIGHT_PX);
|
||||
|
||||
// var grd = this.label.context.createLinearGradient(0, 0, 0, ScoreBoard.FONT_HEIGHT_PX);
|
||||
// grd.addColorStop(0, '#8ED6FF');
|
||||
// grd.addColorStop(1, '#004CB3');
|
||||
// this.label.fill = grd;
|
||||
// this.scoreText.fill = grd;
|
||||
|
||||
// this.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
// this.label.stroke = '#000';
|
||||
// this.label.strokeThickness = 3;
|
||||
};
|
||||
|
||||
ScoreBoard.prototype.printScore = function(score) {
|
||||
this.scoreText.text = score;
|
||||
}
|
||||
|
||||
|
||||
ScoreBoard.FONT_HEIGHT_PX = 70;
|
||||
|
||||
ScoreBoard.DEFAULT_TEXT_FONT = {
|
||||
font: "38px Arial",
|
||||
align: "center",
|
||||
boundsAlignH: "center", // left, center. right
|
||||
boundsAlignV: "middle", // top, middle, bottom
|
||||
fill: "#fff"
|
||||
};
|
||||
@@ -0,0 +1,62 @@
|
||||
ScoreText.prototype = Object.create(Phaser.Text.prototype);
|
||||
ScoreText.constructor = ScoreText;
|
||||
|
||||
function ScoreText(x, y, score) {
|
||||
// super(game, x, y, "+" + NumberUtil.numberWithCommas(score), ScoreText.DEFAULT_TEXT_FONT);
|
||||
var scoreValue = Number(score);
|
||||
if(scoreValue > 0)
|
||||
Phaser.Text.call(this, game, x, y, "+" + NumberUtil.numberWithCommas(score), ScoreText.DEFAULT_TEXT_FONT);
|
||||
else if(scoreValue < 0)
|
||||
Phaser.Text.call(this, game, x, y, NumberUtil.numberWithCommas(score), ScoreText.DEFAULT_TEXT_FONT);
|
||||
|
||||
this.anchor.set(0.5);
|
||||
this.inputEnabled = false;
|
||||
|
||||
var grd = this.context.createLinearGradient(0, 0, 0, this.height);
|
||||
if(scoreValue < 0) {
|
||||
grd.addColorStop(0, ScoreText.COLOR_MINUS_SCORE_GRADATION_1);
|
||||
grd.addColorStop(1, ScoreText.COLOR_MINUS_SCORE_GRADATION_2);
|
||||
} else {
|
||||
grd.addColorStop(0, ScoreText.COLOR_PLUS_SCORE_GRADATION_1);
|
||||
grd.addColorStop(1, ScoreText.COLOR_PLUS_SCORE_GRADATION_2);
|
||||
}
|
||||
this.fill = grd;
|
||||
// this.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
this.stroke = '#fff';
|
||||
this.strokeThickness = 5;
|
||||
|
||||
|
||||
var tweenAlpha = game.add.tween(this);
|
||||
tweenAlpha.to( { alpha: 0 }, 1000, Phaser.Easing.Linear.None, true);
|
||||
|
||||
var tweenMoveUp = game.add.tween(this);
|
||||
tweenMoveUp.to( { y: this.y - ScoreText.MOVE_UP_AMOUNT_PX }, 1000, Phaser.Easing.Linear.None, true);
|
||||
tweenMoveUp.onComplete.addOnce(this.destroySelf, this);
|
||||
|
||||
game.add.existing(this);
|
||||
};
|
||||
|
||||
ScoreText.prototype.destroySelf = function() {
|
||||
this.destroy();
|
||||
}
|
||||
|
||||
|
||||
ScoreText.prototype.setScale = function(value) {
|
||||
this.scale.set(value);
|
||||
}
|
||||
|
||||
|
||||
ScoreText.DEFAULT_TEXT_FONT = {
|
||||
font: "30px Arial",
|
||||
boundsAlignH: "center", // left, center. right
|
||||
boundsAlignV: "middle", // top, middle, bottom
|
||||
fill: "#fff"
|
||||
};
|
||||
|
||||
ScoreText.MOVE_UP_AMOUNT_PX = 50;
|
||||
|
||||
ScoreText.COLOR_PLUS_SCORE_GRADATION_1 = "#8ED6FF";
|
||||
ScoreText.COLOR_PLUS_SCORE_GRADATION_2 = "#004CB3";
|
||||
|
||||
ScoreText.COLOR_MINUS_SCORE_GRADATION_1 = "#FFD68E";
|
||||
ScoreText.COLOR_MINUS_SCORE_GRADATION_2 = "#B34C00";
|
||||
@@ -0,0 +1,80 @@
|
||||
function ScreenBottomUI() {
|
||||
this.dbConnectManager = new DBConnectManager();
|
||||
|
||||
this.bottomBarCenterY = game.world.height - ScreenBottomUI.BG_HEIGHT / 2;
|
||||
|
||||
this.drawBG();
|
||||
this.leftText = this.printText(this.leftText, "", "left");
|
||||
this.centerText = this.printText(this.centerText, "", "center");
|
||||
this.rightText = this.printText(this.rightText, "", "right");
|
||||
}
|
||||
|
||||
ScreenBottomUI.prototype.drawBG = function() {
|
||||
game.add.graphics()
|
||||
.beginFill(0x303030, 1)
|
||||
.drawRect(
|
||||
0, game.world.height - ScreenBottomUI.BG_HEIGHT,
|
||||
game.world.width, ScreenBottomUI.BG_HEIGHT
|
||||
);
|
||||
}
|
||||
|
||||
ScreenBottomUI.prototype.printLeftText = function(text) {
|
||||
this.leftText.text = text;
|
||||
}
|
||||
|
||||
ScreenBottomUI.prototype.printCenterText = function(text) {
|
||||
this.centerText.text = text;
|
||||
}
|
||||
|
||||
ScreenBottomUI.prototype.printRightText = function(text) {
|
||||
this.rightText.text = text;
|
||||
}
|
||||
|
||||
ScreenBottomUI.prototype.printText = function(textObject, text, align) {
|
||||
if(textObject !== null && textObject !== undefined) {
|
||||
textObject.text = "";
|
||||
textObject = null;
|
||||
}
|
||||
|
||||
var posX = 0;
|
||||
var anchorValue = 0;
|
||||
switch(align) {
|
||||
case "left":
|
||||
posX = ScreenBottomUI.TEXT_OFFSET;
|
||||
break;
|
||||
|
||||
case "center":
|
||||
posX = game.world.centerX;
|
||||
anchorValue = 0.5;
|
||||
break;
|
||||
|
||||
case "right":
|
||||
posX = game.world.width - ScreenBottomUI.TEXT_OFFSET;
|
||||
anchorValue = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
textObject = game.add.text(posX, this.bottomBarCenterY, text, this.getFontStyle());
|
||||
|
||||
textObject.anchor.x = anchorValue;
|
||||
textObject.anchor.y = 0.5;
|
||||
|
||||
return textObject;
|
||||
}
|
||||
|
||||
ScreenBottomUI.prototype.printLeftTextWithAppHighestRecord = function(bestRecord) {
|
||||
this.printLeftText(
|
||||
"최고 기록 : "
|
||||
+ RecordUtil.getRecordValueWithUnit(bestRecord, sessionStorageManager.getPlayingAppID())
|
||||
);
|
||||
}
|
||||
|
||||
ScreenBottomUI.prototype.getFontStyle = function() {
|
||||
return { font: "32px Arial", fill: "#fff", align: "left", boundsAlignH: "left", boundsAlignV: "bottom" };
|
||||
}
|
||||
|
||||
|
||||
ScreenBottomUI.BG_HEIGHT = 50;
|
||||
|
||||
ScreenBottomUI.NAME_WIDTH = 200;
|
||||
ScreenBottomUI.TEXT_OFFSET = 10;
|
||||
@@ -0,0 +1,27 @@
|
||||
function ScreenTopUI() {
|
||||
this.drawBG();
|
||||
}
|
||||
|
||||
ScreenTopUI.prototype.drawBG = function() {
|
||||
game.add.graphics()
|
||||
.beginFill(0x303030, 1)
|
||||
.drawRect(
|
||||
0, 0,
|
||||
game.world.width, ScreenTopUI.BG_HEIGHT
|
||||
);
|
||||
}
|
||||
|
||||
ScreenTopUI.prototype.makeBackButton = function(eventHandler) {
|
||||
this.backButton = new BackButton(eventHandler);
|
||||
}
|
||||
|
||||
ScreenTopUI.prototype.makeHomeButton = function(eventHandler) {
|
||||
this.homeButton = new HomeButton(eventHandler);
|
||||
}
|
||||
|
||||
ScreenTopUI.prototype.makeFullScreenButton = function() {
|
||||
// this.fullscreenButton = new FullscreenButton();
|
||||
}
|
||||
|
||||
|
||||
ScreenTopUI.BG_HEIGHT = 60;
|
||||
Reference in New Issue
Block a user