Commit 53c1561f authored by 18손재민's avatar 18손재민

호패 씬에서 입력 길이에 따라 입력창 길이가 달라지게 함

parent 3d59e452
...@@ -306,13 +306,15 @@ Input.inputField = ...@@ -306,13 +306,15 @@ Input.inputField =
{ {
generate: function(scene, enterCallback, text, isHopaeScene = false) generate: function(scene, enterCallback, text, isHopaeScene = false)
{ {
this.text = text; this.text = text.getElement('text');
this.inputBackground = text.getElement('background');
scene.input.keyboard.on('keyup', function() {Input.pressCount--; Input.justPressed = ''; scene.input.keyboard.on('keyup', function() {Input.pressCount--; Input.justPressed = '';
if(isHopaeScene) if(isHopaeScene)
{ {
ScenesData.hopaeScene.checkBtn.setEnable(Input.checkProperInput(Input.inputField.text.text) || (Input.finalInput.length > 1) ? true : false); ScenesData.hopaeScene.checkBtn.setEnable(Input.checkProperInput(Input.inputField.text.text) || (Input.finalInput.length > 1) ? true : false);
ScenesData.hopaeScene.warningText.setVisible(Input.finalInput.length > 4 ? true : false); ScenesData.hopaeScene.warningText.setVisible(Input.finalInput.length > 4 ? true : false);
if(Input.finalInput.length > 1) Input.inputField.inputBackground.setFrame(Input.finalInput.length - 2);
}}) }})
scene.input.keyboard.on('keydown-SHIFT', function() {Input.isShifted = true}); scene.input.keyboard.on('keydown-SHIFT', function() {Input.isShifted = true});
scene.input.keyboard.on('keyup-SHIFT', function() {Input.isShifted = false}); scene.input.keyboard.on('keyup-SHIFT', function() {Input.isShifted = false});
......
...@@ -42,6 +42,7 @@ ResourceLoader.loadImage = function(scene) ...@@ -42,6 +42,7 @@ ResourceLoader.loadImage = function(scene)
scene.load.image('pyeongminStand', 'assets/image/character/pyeongmin/pyeong_stand.png'); scene.load.image('pyeongminStand', 'assets/image/character/pyeongmin/pyeong_stand.png');
scene.load.spritesheet('wordBreak', 'assets/image/word/wordbreak.png', { frameWidth: 180, frameHeight: 180 }); scene.load.spritesheet('wordBreak', 'assets/image/word/wordbreak.png', { frameWidth: 180, frameHeight: 180 });
scene.load.spritesheet('hopaeSceneInput', 'assets/image/word/hopaeSceneInput.png', { frameWidth: 239, frameHeight: 45 });
scene.load.image('attackPaper', 'assets/image/etc/paper_crumbled.png'); scene.load.image('attackPaper', 'assets/image/etc/paper_crumbled.png');
scene.load.image('button', 'assets/placeholder/button.png'); scene.load.image('button', 'assets/placeholder/button.png');
scene.load.image('panel', 'assets/placeholder/panel.png'); scene.load.image('panel', 'assets/placeholder/panel.png');
...@@ -52,11 +53,6 @@ ResourceLoader.loadImage = function(scene) ...@@ -52,11 +53,6 @@ ResourceLoader.loadImage = function(scene)
scene.load.image('shopBtn', 'assets/image/UI/main/shop.png'); scene.load.image('shopBtn', 'assets/image/UI/main/shop.png');
scene.load.image('hopaeManageBtn', 'assets/image/UI/main/hopaeManage.png'); scene.load.image('hopaeManageBtn', 'assets/image/UI/main/hopaeManage.png');
scene.load.image('helpBtn', 'assets/image/UI/main/help.png'); scene.load.image('helpBtn', 'assets/image/UI/main/help.png');
scene.load.image('helpBtn', 'assets/image/UI/decisionBtn/spectate.png');
scene.load.image('helpBtn', 'assets/image/UI/decisionBtn/help.png');
scene.load.image('helpBtn', 'assets/image/UI/decisionBtn/help.png');
scene.load.image('helpBtn', 'assets/image/UI/decisionBtn/help.png');
......
...@@ -249,9 +249,10 @@ var hopaeScene = new Phaser.Class( ...@@ -249,9 +249,10 @@ var hopaeScene = new Phaser.Class(
create: function() create: function()
{ {
BackGround.drawBackground(this); BackGround.drawBackground(this);
this.inputBackground = UIObject.createLabel(this, game.config.width / 2, game.config.height / 2, 10, 'hopaeSceneInput', 2, 'center', '', 50, '#ffffff', 0.45, 0.5);
Input.inputField.generate(this, function(){}, Input.inputField.generate(this, function(){}, this.inputBackground, true);
UIObject.createLabel(this, game.config.width / 2, game.config.height / 2, 10, 'nameBgr6', 2, 'center', '', 50, '#ffffff').getElement('text').setOrigin(0.45,0.5), true);
UIObject.createLabel(this, game.config.width / 2, game.config.height / 2 - 200, 2, 'noticeBackground', 1, 'center', UIObject.createLabel(this, game.config.width / 2, game.config.height / 2 - 200, 2, 'noticeBackground', 1, 'center',
'호패는 오직 한글만 입력이 가능합니다.\n띄어쓰기도 사용할 수 없습니다.', 50, '#000000').layout(); '호패는 오직 한글만 입력이 가능합니다.\n띄어쓰기도 사용할 수 없습니다.', 50, '#000000').layout();
...@@ -467,7 +468,7 @@ var gameScene = new Phaser.Class( ...@@ -467,7 +468,7 @@ var gameScene = new Phaser.Class(
WordSpace.wordPhysicsGroup = this.physics.add.group(); WordSpace.wordPhysicsGroup = this.physics.add.group();
Input.inputField.generate(this, Input.gameSceneEnterReaction, Input.inputField.generate(this, Input.gameSceneEnterReaction,
UIObject.createLabel(ScenesData.gameScene, game.config.width / 2, game.config.height * 25 / 36, 10, 'inputfield', 1, 'center', '', 25, '#000000').getElement('text')); UIObject.createLabel(ScenesData.gameScene, game.config.width / 2, game.config.height * 25 / 36, 10, 'inputfield', 1, 'center', '', 25, '#000000'));
WordSpace.attackGauge.generate(this); WordSpace.attackGauge.generate(this);
WordSpace.spaceInitiate(this); WordSpace.spaceInitiate(this);
......
...@@ -57,8 +57,6 @@ class WordObject ...@@ -57,8 +57,6 @@ class WordObject
setTimeout(function() { setTimeout(function() {
breakAnim.destroy(); breakAnim.destroy();
}, 200); }, 200);
RoomData.myself.playerImage.play(WordSpace.pyeongminAnims[Enums.characterAnim.write]);
RoomData.myself.playerImage.anims.chain(WordSpace.pyeongminAnims[Enums.characterAnim.sit]);
} }
attract() attract()
...@@ -110,6 +108,8 @@ class NormalWord extends WordObject ...@@ -110,6 +108,8 @@ class NormalWord extends WordObject
super.destroy(); super.destroy();
if(isNormallyRemoved) if(isNormallyRemoved)
{ {
RoomData.myself.playerImage.play(WordSpace.pyeongminAnims[Enums.characterAnim.write]);
RoomData.myself.playerImage.anims.chain(WordSpace.pyeongminAnims[Enums.characterAnim.sit]);
switch(this.wordGrade) switch(this.wordGrade)
{ {
case 0: WordSpace.attackGauge.add(2.5); break; case 0: WordSpace.attackGauge.add(2.5); break;
...@@ -189,6 +189,8 @@ class AttackWord extends WordObject ...@@ -189,6 +189,8 @@ class AttackWord extends WordObject
super.destroy(); super.destroy();
if(isNormallyRemoved) if(isNormallyRemoved)
{ {
RoomData.myself.playerImage.play(WordSpace.pyeongminAnims[Enums.characterAnim.write]);
RoomData.myself.playerImage.anims.chain(WordSpace.pyeongminAnims[Enums.characterAnim.sit]);
switch(this.wordGrade) switch(this.wordGrade)
{ {
case 0: WordSpace.attackGauge.add(2.5); break; case 0: WordSpace.attackGauge.add(2.5); break;
...@@ -271,6 +273,8 @@ class NameWord extends WordObject ...@@ -271,6 +273,8 @@ class NameWord extends WordObject
super.destroy(); super.destroy();
if(isNormallyRemoved) if(isNormallyRemoved)
{ {
RoomData.myself.playerImage.play(WordSpace.pyeongminAnims[Enums.characterAnim.write]);
RoomData.myself.playerImage.anims.chain(WordSpace.pyeongminAnims[Enums.characterAnim.sit]);
ScenesData.gameScene.physics.world.removeCollider(this.physicsObj.wordCollider); ScenesData.gameScene.physics.world.removeCollider(this.physicsObj.wordCollider);
WordSpace.wordGroup.forEach(function(element) WordSpace.wordGroup.forEach(function(element)
{ {
...@@ -356,6 +360,8 @@ class ItemWord extends WordObject ...@@ -356,6 +360,8 @@ class ItemWord extends WordObject
super.destroy(); super.destroy();
if(isNormallyRemoved) if(isNormallyRemoved)
{ {
RoomData.myself.playerImage.play(WordSpace.pyeongminAnims[Enums.characterAnim.write]);
RoomData.myself.playerImage.anims.chain(WordSpace.pyeongminAnims[Enums.characterAnim.sit]);
WordSpace.attackGauge.add(0.5); WordSpace.attackGauge.add(0.5);
switch(this.itemType) switch(this.itemType)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment