PIXI Controls: Debug enable button
This commit is contained in:
parent
03775afea1
commit
b5d5cc6c89
3 changed files with 42 additions and 0 deletions
|
@ -51,6 +51,15 @@
|
|||
z-index: 1489;
|
||||
}
|
||||
|
||||
.new-button {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 5px;
|
||||
width: 90px;
|
||||
height: 40px;
|
||||
z-index: 1489;
|
||||
}
|
||||
|
||||
.gamepad-buttons {
|
||||
opacity: 0.6;
|
||||
z-index: 1488;
|
||||
|
|
|
@ -66,6 +66,24 @@ function create_fps_button() {
|
|||
}
|
||||
}
|
||||
|
||||
function create_new_controls() {
|
||||
// Remove in release
|
||||
const NewBtn = document.createElement("div");
|
||||
NewBtn.className = "new-button";
|
||||
document.body.appendChild(NewBtn);
|
||||
|
||||
NewBtn.addEventListener("pointerdown", () => {
|
||||
var controls_canvas = document.getElementById("ControlsCanvas");
|
||||
if (controls_canvas === null) {
|
||||
document.getElementById("show-gamepad").remove();
|
||||
ONSControls.initialize();
|
||||
} else {
|
||||
controls_canvas.remove();
|
||||
create_show_button();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function create_dpad_buttons() {
|
||||
// Скуфting elements
|
||||
const DivDMain = document.createElement("div");
|
||||
|
@ -283,6 +301,7 @@ function setupKey(id, key, keyCode) {
|
|||
|
||||
window.addEventListener('load', () => {
|
||||
create_fps_button(); // Remove in release
|
||||
create_new_controls(); // Remove in release
|
||||
if (navigator.getGamepads().length == 0) {
|
||||
create_control_buttons();
|
||||
create_dpad_buttons();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue