Commit d63056b5 authored by 18손재민's avatar 18손재민

버튼 오브젝트 결국 따로 만듬. 메인 메뉴에서 보여주는 호패들을 rexUI를 쓰지 않기로 결정함 현재 호패들 닫는 것 wip

parent aad6fb14
...@@ -76,7 +76,7 @@ class GameRoom ...@@ -76,7 +76,7 @@ class GameRoom
{ {
this.roomId = GameServer.getRoomNumber(); this.roomId = GameServer.getRoomNumber();
this.roomIndex = -1; this.roomIndex = -1;
this.startCount = 3; this.startCount = 2;
this.maxPlayer = 100; this.maxPlayer = 100;
this.nextRank = 100; this.nextRank = 100;
......
...@@ -230,6 +230,7 @@ FirebaseClient.prototype.updateUserData = function(key, valueChanged, replace = ...@@ -230,6 +230,7 @@ FirebaseClient.prototype.updateUserData = function(key, valueChanged, replace =
break; break;
} }
PlayerData.userData = beforeData; PlayerData.userData = beforeData;
console.log(beforeData);
return this.database.ref('/user-data/' + this.auth.currentUser.uid).update(beforeData); return this.database.ref('/user-data/' + this.auth.currentUser.uid).update(beforeData);
} }
......
...@@ -322,7 +322,6 @@ Input.inputField = ...@@ -322,7 +322,6 @@ Input.inputField =
generate: function(scene, enterCallback, text, isHopaeScene = false) generate: function(scene, enterCallback, text, isHopaeScene = false)
{ {
this.text = text; this.text = text;
//this.text = scene.add.text(background.x, background.y, "", {font: fontSize + 'pt 궁서'}).setOrigin(0.5, 0.5).setColor('#000000').setDepth(10);
scene.input.keyboard.on('keyup', function() {Input.pressCount--; Input.justPressed = ''; scene.input.keyboard.on('keyup', function() {Input.pressCount--; Input.justPressed = '';
if(isHopaeScene) if(isHopaeScene)
......
...@@ -11,7 +11,7 @@ ResourceLoader.loadBackGround = function(scene) ...@@ -11,7 +11,7 @@ ResourceLoader.loadBackGround = function(scene)
ResourceLoader.loadImage = function(scene) ResourceLoader.loadImage = function(scene)
{ {
scene.load.image('inputfield', 'assets/placeholder/inputfield.png'); scene.load.image('inputfield', 'assets/image/etc/wordspace.png');
for (let i = 0; i < 4; i++) for (let i = 0; i < 4; i++)
{ {
for (let j = 2; j < 7; j++) for (let j = 2; j < 7; j++)
......
This diff is collapsed.
...@@ -10,8 +10,8 @@ UIObject.createLabel = function (scene, x, y, depth, image, size, text = '', tex ...@@ -10,8 +10,8 @@ UIObject.createLabel = function (scene, x, y, depth, image, size, text = '', tex
background: scene.add.sprite(x, y, image).setScale(size).setOrigin(0.5, 0.5).setDepth(depth), background: scene.add.sprite(x, y, image).setScale(size).setOrigin(0.5, 0.5).setDepth(depth),
text: scene.add.text(x, y, text, { text: scene.add.text(x, y, text, {
fontSize: textSize + 'pt' font: textSize + 'pt 궁서'
}).setDepth(depth).setOrigin(textOriginX, textOriginY).setColor(textColor).setFontFamily('궁서'), }).setDepth(depth).setOrigin(textOriginX, textOriginY).setColor(textColor),
space: { space: {
left: 10, left: 10,
...@@ -22,26 +22,48 @@ UIObject.createLabel = function (scene, x, y, depth, image, size, text = '', tex ...@@ -22,26 +22,48 @@ UIObject.createLabel = function (scene, x, y, depth, image, size, text = '', tex
}); });
} }
class Button extends Phaser.GameObjects.Sprite{ UIObject.createButton = function(scene, buttonGameObject, overFrame, outFrame, downFrame, clickCallback) {
var temp = scene.rexUI.add.buttons({
constructor(scene, x, y, texture, overFrame, outFrame, downFrame) x: 0,
{ y: 0,
super(scene, x, y, texture); width: undefined,
scene.add.existing(this); height: undefined,
orientation: 0,
this.setFrame(outFrame).setInteractive() buttons: [
buttonGameObject,
],
click: {
mode: 'pointerdown',
clickInterval: 100
}
});
buttonGameObject = buttonGameObject.getElement('background');
temp.enabled = true;
buttonGameObject.setFrame(outFrame).setInteractive()
.on('pointerover', () => { .on('pointerover', () => {
this.setFrame(overFrame) if(temp.enabled)
{
buttonGameObject.setFrame(overFrame);
}
}) })
.on('pointerdown', () => { .on('pointerdown', () => {
this.setFrame(downFrame) if(temp.enabled)
{
buttonGameObject.setFrame(downFrame);
clickCallback();
}
}) })
.on('pointerup', () => { .on('pointerup', () => {
this.setFrame(overFrame) buttonGameObject.setFrame(outFrame);
}) })
.on('pointerout', () => { .on('pointerout', () => {
this.setFrame(outFrame) buttonGameObject.setFrame(outFrame);
}) })
temp.setEnable = function(isEnable)
{
temp.enabled = isEnable;
return temp;
} }
return temp;
} }
\ No newline at end of file
...@@ -13,7 +13,7 @@ app.get('/', function(req, res) { ...@@ -13,7 +13,7 @@ app.get('/', function(req, res) {
}); });
// http 기본 포트(80)에 서버 열기 // http 기본 포트(80)에 서버 열기
server.listen(8080, function() { server.listen(80, function() {
console.log('[SERVER] Listening on port ' + server.address().port); console.log('[SERVER] Listening on port ' + server.address().port);
}); });
......
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