1 changed files with 30 additions and 40 deletions
@ -1,45 +1,35 @@ |
|||||
import Button from "@/components/Button"; |
import Button from "@/components/Button"; |
||||
import { gameManager, defineWindow, stageManager } from "@/Game"; |
import soundManager from "@/utils/Sound"; |
||||
import Sound from "@/Game/Sound"; |
import { Container } from "pixi.js"; |
||||
import { Container, Graphics, Text } from "pixi.js"; |
import { BaseScene } from "@/scene/BaseScene"; |
||||
|
import { SceneType } from "@/enums/SceneType"; |
||||
|
import position from "@/utils/Position"; |
||||
|
|
||||
import Circle from "./circle" |
export default class WelcomeScene extends BaseScene { |
||||
import { PWindow } from "@/Game/type"; |
stage: Container = new Container(); |
||||
import Position from "@/Game/Position"; |
|
||||
|
|
||||
|
constructor() { |
||||
|
super("welcome", SceneType.Normal); |
||||
|
} |
||||
|
|
||||
export default defineWindow("welcome", class extends PWindow { |
async layout(): Promise<void> { |
||||
stage: Container = null |
const btn = new Button({ |
||||
text: any |
text: "进入游戏", |
||||
layout() { |
onClick: () => { |
||||
const circle = Circle.render() |
this.changeScene("welcome2"); |
||||
this.stage.addChild(circle) |
}, |
||||
circle.on("touchend", () => { |
position: () => position.center(), |
||||
this.changeStage("welcome2") |
}); |
||||
}) |
|
||||
circle.on("mousedown", () => { |
|
||||
this.changeStage("welcome2") |
|
||||
}) |
|
||||
// this.text = new Text({text: "修仙人生日常"})
|
|
||||
|
|
||||
// this.stage.addChild(this.text)
|
this.stage.addChild(btn.container); |
||||
const btn = new Button({ |
} |
||||
text: "修仙人生日常", position: () => Position.get("center", "center"), click: () => { |
|
||||
this.changeStage("init") |
onLoad(): void { |
||||
} |
console.log("welcome onLoad"); |
||||
}) |
} |
||||
this.stage.addChild(btn._comp) |
|
||||
} |
onUnLoad(): void { |
||||
onLoad() { |
soundManager.stop("my-sound"); |
||||
console.log("onLoad 1"); |
console.log("welcome onUnLoad"); |
||||
} |
} |
||||
onUnLoad() { |
} |
||||
Sound.stop("my-sound") |
|
||||
console.log("onUnLoad 1"); |
|
||||
} |
|
||||
update() { |
|
||||
// this.text.x = gameManager.getInfo().width-this.text.width
|
|
||||
// this.text.y = gameManager.getInfo().height-this.text.height
|
|
||||
// console.log(22);
|
|
||||
} |
|
||||
}) |
|
||||
Loading…
Reference in new issue