Add: ScreenBottom
This commit is contained in:
+8
-111
@@ -1,121 +1,18 @@
|
||||
/////////////////////////////
|
||||
// MenuApp
|
||||
|
||||
var MenuApp = {
|
||||
let MenuApp = {
|
||||
|
||||
create: function() {
|
||||
this.stageButtonArray = [];
|
||||
this.game.stage.backgroundColor = '#4d4d4d';
|
||||
|
||||
var bar = game.add.graphics();
|
||||
bar.beginFill(0x000000, 0.2);
|
||||
bar.drawRect(0, 0, 1000, 80);
|
||||
let screenBottom = new ScreenBottom(game);
|
||||
screenBottom.makeBottomLine();
|
||||
screenBottom.printBottomLeftText(playerName);
|
||||
screenBottom.printBottomCenterText("메뉴");
|
||||
screenBottom.printBottomRightText(playerName);
|
||||
|
||||
var newTextStyle = $.extend( {}, textStyleBasic);
|
||||
newTextStyle.font = "bold 64px Arial";
|
||||
|
||||
var textPlayerName = game.add.text(0, 2, "연습 내용", newTextStyle)
|
||||
.setTextBounds(0, 0, 1000, 80)
|
||||
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
|
||||
var phaser = game.add.image(game.world.centerX, game.world.centerY + 70, 'phaser');
|
||||
phaser.anchor.set(0.5);
|
||||
phaser.alpha = 0.1;
|
||||
game.stage.backgroundColor = '#4d4d4d';
|
||||
|
||||
// korean
|
||||
var buttonPosX = 280;
|
||||
var buttonKoreanPosY = 140; // 380;
|
||||
|
||||
game.add.text(0, 2, "한글", newTextStyle)
|
||||
.setTextBounds(0, buttonKoreanPosY + 20, 200, 80)
|
||||
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
|
||||
for(var i = 0; i < 4; i++) {
|
||||
var button = new TextButton(buttonPosX + i * 200, buttonKoreanPosY,
|
||||
koreanLessonTitle[i], this.startStage);
|
||||
button.name = "k" + (i + 1);
|
||||
button.scaleTo(0.9);
|
||||
this.stageButtonArray.push(button);
|
||||
}
|
||||
|
||||
for(var i = 0; i < 4; i++) {
|
||||
var button = new TextButton(buttonPosX + i * 200, buttonKoreanPosY + 100,
|
||||
koreanLessonTitle[i + 4], this.startStage);
|
||||
button.name = "k" + (i + 5);
|
||||
button.scaleTo(0.9);
|
||||
this.stageButtonArray.push(button);
|
||||
}
|
||||
|
||||
var button = new TextButton(buttonPosX, buttonKoreanPosY + 200,
|
||||
koreanLessonTitle[8], this.startStage);
|
||||
button.name = "k9";
|
||||
button.scaleTo(0.9);
|
||||
this.stageButtonArray.push(button);
|
||||
|
||||
var button = new TextButton(buttonPosX + 200, buttonKoreanPosY + 200,
|
||||
koreanLessonTitle[9], this.startStage);
|
||||
button.name = "k10";
|
||||
button.scaleTo(0.9);
|
||||
this.stageButtonArray.push(button);
|
||||
|
||||
|
||||
// english
|
||||
var buttonEnglishPosY = 480;
|
||||
|
||||
game.add.text(0, 2, "영문", newTextStyle)
|
||||
.setTextBounds(0, buttonEnglishPosY + 20, 200, 80)
|
||||
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
|
||||
for(var i = 0; i < 3; i++) {
|
||||
var button = new TextButton(buttonPosX + i * 200, buttonEnglishPosY,
|
||||
englishLessonTitle[i], this.startStage);
|
||||
button.name = "e" + (i + 1);
|
||||
button.scaleTo(0.9);
|
||||
this.stageButtonArray.push(button);
|
||||
}
|
||||
|
||||
for(var i = 0; i < 3; i++) {
|
||||
var button = new TextButton(buttonPosX + i * 200, buttonEnglishPosY + 100,
|
||||
englishLessonTitle[i + 3], this.startStage);
|
||||
button.name = "e" + (i + 4);
|
||||
button.scaleTo(0.9);
|
||||
this.stageButtonArray.push(button);
|
||||
}
|
||||
|
||||
var button = new TextButton(buttonPosX, buttonEnglishPosY + 200,
|
||||
englishLessonTitle[8], this.startStage);
|
||||
button.name = "e9";
|
||||
button.scaleTo(0.9);
|
||||
this.stageButtonArray.push(button);
|
||||
|
||||
var button = new TextButton(buttonPosX + 200, buttonEnglishPosY + 200,
|
||||
englishLessonTitle[9], this.startStage);
|
||||
button.name = "e10";
|
||||
button.scaleTo(0.9);
|
||||
this.stageButtonArray.push(button);
|
||||
|
||||
// for(var i = 0; i < this.stageButtonArray.length; i++) {
|
||||
// console.log("button name : " + this.stageButtonArray[i].name);
|
||||
// }
|
||||
|
||||
// bottom
|
||||
var bottomAreaPositionY = 750;
|
||||
|
||||
var bar = game.add.graphics();
|
||||
bar.beginFill(0xffffff, 0.1);
|
||||
bar.drawRect(0, bottomAreaPositionY, 1000, 50);
|
||||
|
||||
var textStyleInfo = $.extend( {}, textStyleBasic);
|
||||
textStyleInfo.font = "32px Arial";
|
||||
textStyleInfo.align = "right";
|
||||
textStyleInfo.boundsAlignH = "right";
|
||||
|
||||
var textPlayerName = game.add.text(800 - OFFSET_RIGHT_ALIGN, bottomAreaPositionY - 12, playerName, textStyleInfo)
|
||||
.setTextBounds(0, 0, 200, 80)
|
||||
.addColor('#ffffff', 0);
|
||||
// .setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
|
||||
this.loadTypingStageData();
|
||||
// this.loadTypingStageData();
|
||||
},
|
||||
|
||||
loadTypingStageData: function() {
|
||||
|
||||
Reference in New Issue
Block a user