Add: MainColor
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// MainColor.prototype = Object.create(Phaser.Sprite.prototype);
|
||||
MainColor.constructor = MainColor;
|
||||
|
||||
function MainColor() {
|
||||
}
|
||||
|
||||
|
||||
MainColor.LIGHT_CHOCO_STRING = "#BF8763";
|
||||
MainColor.CHOCO_STRING = "#805A42";
|
||||
MainColor.DARK_CHOCO_STRING = "#402D21";
|
||||
MainColor.LIGHTER_CHOCO_STRING = "#E6A277";
|
||||
|
||||
MainColor.LIGHT_CHOCO_HEX = 0xBF8763;
|
||||
MainColor.CHOCO_HEX = 0x805A42;
|
||||
MainColor.DARK_CHOCO_HEX = 0x402D21;
|
||||
MainColor.LIGHTER_CHOCO_HEX = 0xE6A277;
|
||||
@@ -1,26 +0,0 @@
|
||||
function AppAreaBG(color, alpha, x, y, width, height) {
|
||||
game.add.graphics()
|
||||
.beginFill(color, alpha)
|
||||
.drawRect(x, y, width, height);
|
||||
}
|
||||
|
||||
AppAreaBG.prototype.printText = function(text, x, y, size, color, alpha) {
|
||||
var fontStyle = { font: "36px Arial", fill: "#fff", align: "left", boundsAlignH: "left", boundsAlignV: "bottom" };
|
||||
var titleText = game.add.text(x, y, text, fontStyle);
|
||||
titleText.anchor.set(0.5);
|
||||
titleText.fontSize = size;
|
||||
titleText.addColor(color, 0);
|
||||
titleText.alpha = alpha;
|
||||
}
|
||||
|
||||
AppAreaBG.COLOR_MOUSE_APP = 0xffce54;
|
||||
AppAreaBG.COLOR_TYPING_APP = 0x99ccff;
|
||||
|
||||
AppAreaBG.COLOR_TYPING_KOREAN = 0xbbccff;
|
||||
AppAreaBG.COLOR_TYPING_ENGLISH = 0x88bbff;
|
||||
|
||||
AppAreaBG.GAP_X = 10;
|
||||
AppAreaBG.GAP_Y = 10;
|
||||
|
||||
AppAreaBG.MARGIN_X = 20;
|
||||
AppAreaBG.MARGIN_Y = 10;
|
||||
@@ -1,37 +1,13 @@
|
||||
var MainMenu = {
|
||||
|
||||
preload: function() {
|
||||
game.load.image('tile_choco', '../../../resources/image/background/tile_choco.png');
|
||||
game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png');
|
||||
},
|
||||
|
||||
create: function() {
|
||||
game.stage.backgroundColor = '#4d4d4d';
|
||||
|
||||
// mouse app area
|
||||
var mouseBG = new AppAreaBG(
|
||||
AppAreaBG.COLOR_MOUSE_APP, 1,
|
||||
0, 60,
|
||||
GAME_SCREEN_SIZE.x, 280
|
||||
);
|
||||
mouseBG.printText(
|
||||
"마우스 연습 앱",
|
||||
game.world.centerX, 200,
|
||||
170, "#000", 0.03
|
||||
);
|
||||
|
||||
// typing app area
|
||||
var typingBG = new AppAreaBG(
|
||||
AppAreaBG.COLOR_TYPING_APP, 1,
|
||||
0, 340,
|
||||
GAME_SCREEN_SIZE.x, 378
|
||||
);
|
||||
typingBG.printText(
|
||||
"타 자 연 습 앱",
|
||||
game.world.centerX, 490,
|
||||
170, "#000", 0.03
|
||||
);
|
||||
|
||||
|
||||
// keyboard shortcut
|
||||
this.keyboardShortcut = new KeyboardShortcut();
|
||||
this.keyboardShortcut.addCallback(
|
||||
@@ -41,6 +17,11 @@ var MainMenu = {
|
||||
"menu_app" // callerClassName
|
||||
);
|
||||
|
||||
// bg
|
||||
game.add.graphics()
|
||||
.beginFill(MainColor.LIGHT_CHOCO_HEX, 1)
|
||||
.drawRect(0, 0,GAME_SCREEN_SIZE.x, GAME_SCREEN_SIZE.y);
|
||||
|
||||
// top ui
|
||||
// var screenTopUI = new ScreenTopUI();
|
||||
// screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) );
|
||||
@@ -68,7 +49,6 @@ var MainMenu = {
|
||||
this.loadAppData();
|
||||
},
|
||||
|
||||
|
||||
back: function() {
|
||||
sessionStorageManager.clear();
|
||||
location.href = '../../web/client/login.html';
|
||||
|
||||
Reference in New Issue
Block a user