Skip to content

Commit

Permalink
#32: rolling back, strange positioning for now
Browse files Browse the repository at this point in the history
  • Loading branch information
wpernath committed Sep 4, 2022
1 parent 2c698d4 commit 81ef36c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
4 changes: 2 additions & 2 deletions melonjs-client/src/main/client/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const CONFIG = {
//baseURL: "http://localhost:8080/",

// Use a real IP address if you want to do multiplayer testing
//baseURL: "http://192.168.2.198:8080/",
baseURL: "http://192.168.2.171:8080/",
baseURL: "http://192.168.2.198:8080/",
//baseURL: "http://192.168.2.171:8080/",
},

dev: {
Expand Down
2 changes: 1 addition & 1 deletion melonjs-client/src/main/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black">

<title>{{applicationName}} {{applicationVersion}}</title>
<link rel="stylesheet" href="/index.css">
<link rel="stylesheet" href="index.css" />
</head>
<body>
<!-- Canvas placeholder -->
Expand Down
24 changes: 13 additions & 11 deletions melonjs-client/src/main/client/js/stage/multiplayer/mp-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@ class ChangeNamePopup extends BaseContainer {
super(x, y, w, h, {
titleText: "Change Name",
titlePos: "left",
backgroundAlpha: 0.9,
backgroundAlpha: 0.95,
dividerColor: "#005500"
});
let absPos = this.getAbsolutePosition();
this.textInput = new TextInput(
absPos.x + this.contentContainer.pos.x,
absPos.y + this.contentContainer.pos.y,
"text",
MultiplayerManager.get().multiplayerPlayer.name,
32
);
let absPos = new Vector2d(x,y);
x = absPos.x + this.contentContainer.pos.x;
y = absPos.y + this.contentContainer.pos.y;
console.log ("x: " + x + " - y: " + y);
this.textInput = new TextInput(x, y, "text", 32, MultiplayerManager.get().multiplayerPlayer.name);

this.addChild(new BitmapText(x,y, {
text: "Hallo???",
font: "24Outline",
}));
this.addChild(this.textInput);
unbindKeys();
}
Expand Down Expand Up @@ -108,8 +110,8 @@ class MenuComponent extends Container {
this.addChild(new StateBackground("MULTIPLAYER", true, true, true));
this.addChild(new StartGameButton((game.viewport.width - 250)/2, 300));
this.addChild(new JoinGameButton((game.viewport.width - 250) / 2, 360));
this.addChild(new ChangeNameButton((game.viewport.width - 250) / 2, 420));
this.addChild(new BackButton((game.viewport.width - 250) / 2, 480));
//this.addChild(new ChangeNameButton((game.viewport.width - 250) / 2, 420));
this.addChild(new BackButton((game.viewport.width - 250) / 2, 420));
}
}

Expand Down
6 changes: 4 additions & 2 deletions melonjs-client/src/main/client/js/util/text-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ export class TextInput extends Renderable {

super(x, y, length, 16);

this.$input = $('<input type="' + type + '" required>' + def + '</input>').css({
this.$input = $('<input type="' + type + '" required value="' + def + '">').css({
"left" : x,
"top" : y
"top" : y,
"position": "absolute",
"z-index": "2",
});

switch (type) {
Expand Down

0 comments on commit 81ef36c

Please sign in to comment.