Add: MainColor

This commit is contained in:
2019-07-20 22:27:55 +09:00
parent de1dd4ff76
commit 841afa6c1c
4 changed files with 23 additions and 53 deletions
+16
View File
@@ -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;
-26
View File
@@ -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;
+6 -26
View File
@@ -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';
+1 -1
View File
@@ -38,6 +38,7 @@
<script src="../../game/lib/global/global_variables.js?update_date=191224"></script>
<!-- library source files -->
<script src="../../game/lib/color/main_color.js"></script>
<script src="../../game/lib/util/number_util.js"></script>
<script src="../../game/lib/text/input_type_text.js?update_date=191224"></script>
@@ -57,7 +58,6 @@
<script src="../../game/main_menu/main.js"></script>
<script src="../../game/main_menu/welcome_player_text.js"></script>
<script src="../../game/main_menu/notice_experience_player_text.js"></script>
<script src="../../game/main_menu/app_area_bg.js"></script>
<style>