Add: RoundRectButton stroke
This commit is contained in:
@@ -1,117 +0,0 @@
|
||||
/////////////////////////////
|
||||
// Loading
|
||||
|
||||
// var x = 32;
|
||||
// var y = 80;
|
||||
|
||||
var Loading = {
|
||||
|
||||
preload: function() {
|
||||
this.game.load.image('loadingbar', './image/phaser.png');
|
||||
},
|
||||
|
||||
create: function() {
|
||||
// console.log('Loading');
|
||||
|
||||
let userID = sessionStorage.getItem("UserID");
|
||||
console.log("userID : " + userID);
|
||||
|
||||
this.game.stage.backgroundColor = '#4d4d4d';
|
||||
|
||||
// Progress report
|
||||
this.textProgress = game.add.text(game.world.centerX, 100, '로딩중 . . .', textStyleBasic);
|
||||
this.textProgress.anchor.setTo(0.5, 0.4);
|
||||
this.textProgress.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
|
||||
// Preload bar
|
||||
this.preloadBar = this.add.sprite(game.world.centerX, game.world.centerY, 'loadingbar');
|
||||
this.preloadBar.anchor.setTo(0.5);
|
||||
this.preloadBar.alpha = 0;
|
||||
|
||||
this.game.load.onFileComplete.add(this.fileComplete, this);
|
||||
this.game.load.onLoadComplete.add(this.loadComplete, this);
|
||||
|
||||
this.startLoading();
|
||||
},
|
||||
|
||||
startLoading: function() {
|
||||
// this.game.load.image('a', './image/phaser.png');
|
||||
// this.game.load.image('b', './image/phaser.png');
|
||||
// this.game.load.image('c', './image/phaser.png');
|
||||
// this.game.load.image('d', './image/phaser.png');
|
||||
// this.game.load.image('e', './image/phaser.png');
|
||||
// this.game.load.image('g', './image/phaser.png');
|
||||
// this.game.load.image('e', './image/phaser.png');
|
||||
// this.game.load.image('f', './image/phaser.png');
|
||||
// this.game.load.image('g', './image/phaser.png');
|
||||
// this.game.load.image('h', './image/phaser.png');
|
||||
|
||||
this.game.load.image('phaser', './image/phaser.png');
|
||||
this.game.load.spritesheet('button', './image/button_basic.png', 200, 100);
|
||||
this.game.load.image('star', './image/star_particle.png');
|
||||
this.game.load.image('medal_gold', './image/medal_gold.png');
|
||||
this.game.load.image('medal_silver', './image/medal_silver.png');
|
||||
this.game.load.image('medal_bronze', './image/medal_bronze.png');
|
||||
|
||||
this.game.load.start();
|
||||
},
|
||||
|
||||
fileComplete: function(progress, cacheKey, success, totalLoaded, totalFiles) {
|
||||
this.preloadBar.alpha = progress / 100;
|
||||
|
||||
// console.log('progress : ' + progress);
|
||||
|
||||
/*
|
||||
text.setText("File Complete: " + progress + "% - " + totalLoaded + " out of " + totalFiles);
|
||||
|
||||
var newImage = game.add.image(x, y, cacheKey);
|
||||
newImage.scale.set(0.3);
|
||||
|
||||
x += newImage.width + 20;
|
||||
if (x > 700)
|
||||
{
|
||||
x = 32;
|
||||
y += 332;
|
||||
}
|
||||
*/
|
||||
},
|
||||
|
||||
loadComplete: function(progress, cacheKey, success, totalLoaded, totalFiles) {
|
||||
this.preloadBar.alpha = 1;
|
||||
|
||||
if(isReleaseMode()) {
|
||||
this.state.start('Login');
|
||||
return;
|
||||
}
|
||||
|
||||
this.state.start('Login');
|
||||
// this.startMenu();
|
||||
// this.startTypingTestStage();
|
||||
// this.startTypingTestResult();
|
||||
},
|
||||
|
||||
startMenu: function() {
|
||||
this.setupTestData();
|
||||
this.state.start('Menu');
|
||||
},
|
||||
|
||||
startTypingTestStage: function() {
|
||||
this.setupTestData();
|
||||
this.state.start('TypingTestStage');
|
||||
},
|
||||
|
||||
startTypingTestResult: function() {
|
||||
this.setupTestData();
|
||||
this.state.start('TypingTestResult');
|
||||
},
|
||||
|
||||
setupTestData: function() {
|
||||
playerUserID = 1;
|
||||
playerName = "박지상";
|
||||
|
||||
bestRecord = 300;
|
||||
typingRecordTotal = 400;
|
||||
playingStageData = new StageData(LANGUAGE_KOREAN, 1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
/////////////////////////////
|
||||
// Screen bottom
|
||||
|
||||
class ScreenBottom {
|
||||
|
||||
constructor(game) {
|
||||
this.game = game;
|
||||
|
||||
this.BOTTOM_BAR_HEIGHT = 50;
|
||||
this.BOTTOM_BAR_NAME_WIDTH = 200;
|
||||
this.BOTTOM_BAR_TEXT_OFFSET = 10;
|
||||
|
||||
this.bottomAreaPositionY = this.game.world.height - this.BOTTOM_BAR_HEIGHT;
|
||||
}
|
||||
|
||||
makeBottomLine() {
|
||||
this.game.add.graphics()
|
||||
.beginFill(0xffffff, 0.1)
|
||||
.drawRect(0, this.bottomAreaPositionY, game.world.width, this.BOTTOM_BAR_HEIGHT);
|
||||
|
||||
|
||||
this.printBottomLeftText(playerName);
|
||||
this.printBottomCenterText("메뉴");
|
||||
this.printBottomRightText(playerName);
|
||||
|
||||
let textStyleInfo = textStyleBasic; //$.extend( {}, textStyleBasic);
|
||||
textStyleInfo.font = "32px Arial";
|
||||
textStyleInfo.align = "right";
|
||||
textStyleInfo.boundsAlignH = "right";
|
||||
}
|
||||
|
||||
printBottomLeftText(text) {
|
||||
let style = { font: "32px Arial", fill: "#fff", align: "left", boundsAlignH: "left", boundsAlignV: "bottom" };
|
||||
|
||||
let posX = this.BOTTOM_BAR_TEXT_OFFSET;
|
||||
this.game.add.text(posX, this.bottomAreaPositionY, text, style)
|
||||
.setTextBounds(0, 0, this.BOTTOM_BAR_NAME_WIDTH, this.BOTTOM_BAR_HEIGHT)
|
||||
.addColor('#ffffff', 0);
|
||||
// .setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
}
|
||||
|
||||
printBottomCenterText(text) {
|
||||
let style = { font: "32px Arial", fill: "#fff", align: "center", boundsAlignH: "center", boundsAlignV: "bottom" };
|
||||
|
||||
let posX = game.world.width / 2 - this.BOTTOM_BAR_NAME_OFFSET_RIGHT;
|
||||
this.game.add.text(0, this.bottomAreaPositionY, text, style)
|
||||
.setTextBounds(0, 0, game.world.width, this.BOTTOM_BAR_HEIGHT)
|
||||
.addColor('#ffffff', 0);
|
||||
// .setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
}
|
||||
|
||||
printBottomRightText(text) {
|
||||
let style = { font: "32px Arial", fill: "#fff", align: "right", boundsAlignH: "right", boundsAlignV: "bottom" };
|
||||
|
||||
let posX = game.world.width - this.BOTTOM_BAR_NAME_WIDTH - this.BOTTOM_BAR_TEXT_OFFSET;
|
||||
this.game.add.text(posX, this.bottomAreaPositionY, text, style)
|
||||
.setTextBounds(0, 0, this.BOTTOM_BAR_NAME_WIDTH, this.BOTTOM_BAR_HEIGHT)
|
||||
.addColor('#ffffff', 0);
|
||||
// .setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user