Files
ResistanceRacing2k97/src/ui/panelWelcome.js
T

55 lines
2.0 KiB
JavaScript
Raw Normal View History

2026-10-23 00:24:27 +02:00
import Button from "./button.js";
import {SliderHorizontal, SliderVertical} from "./slider.js";
export default class PanelWelcome{
constructor(_scene) {
this.scene = _scene;
//stop use click clicking immediatly again and eg hit the back btn
this.scene.hand.justPressed = false;
this.scene.hand.pressed = false;
this.scene.hand.justReleased = false;
this.bgGraphics = this.scene.add.graphics();
this.bgGraphics.fillStyle(0x000000, 0.9);
this.bgGraphics.fillRect(this.scene.left, this.scene.top, this.scene.game.config.width, this.scene.game.config.height);
/*
this.bgSprite = this.scene.add.sprite(0, this.scene.bottom - (25 * 4), "klimtUI01");
this.bgSprite.setScale(4);
this.bgSpriteOver = this.scene.add.sprite(0, this.scene.bottom - (40 * 4), "klimtUI02");
this.bgSpriteOver.setScale(4);
*/
let btnPos = { x: 0, y: this.scene.bottom - (25 * 4) };
if(isMobile === true){
btnPos.y = 155;
}
this.btnPlay = new Button(this.scene, { x: btnPos.x, y: btnPos.y }, "atlasUi", "sprBtn00Invisible", "START GAME", false, () => {
this.destroy();
this.scene.player.setMode(PLAYERMODE.LOOK);
this.scene.player.panel = null;
});
this.btnToEditor = new Button(this.scene, { x: this.scene.left + 64, y: this.scene.bottom - 24 }, "atlasUi", "sprBtn01", "Editor", false, () => {
//$("#optionbox").hide();
//this.scene.scene.start("Scn3d", { level: "modelBuilder" });
this.destroy();
this.scene.player.setMode(PLAYERMODE.LOOK);
this.scene.player.panel = null;
this.scene.loadLevel("modelBuilder");
});
}
update(){
this.btnPlay.update();
this.btnToEditor.update();
}
destroy(){
this.bgGraphics.destroy();
this.btnPlay.destroy();
this.btnToEditor.destroy();
}
}