|
|
|
@ -1,10 +1,10 @@ |
|
|
|
import { Button } from "@/components/Button"; |
|
|
|
import { gameManager, defineWindow, stageManager } from "@/Game"; |
|
|
|
import { defineWindow } from "@/Game"; |
|
|
|
import Position from "@/Game/Position"; |
|
|
|
import Sound from "@/Game/Sound"; |
|
|
|
import { Container, Sprite, Text, NineSlicePlane, Texture, AnimatedSprite, Rectangle, Assets, AssetsBundle, NineSliceSprite, Ticker } from "pixi.js"; |
|
|
|
import { Container, Text, NineSliceSprite, AnimatedSprite, Rectangle, Ticker, Texture } from "pixi.js"; |
|
|
|
import { PWindow } from "@/Game/type"; |
|
|
|
import { loadAsset, unLoadAsset } from "@/Game/Assets"; |
|
|
|
import { loadAsset } from "@/Game/Assets"; |
|
|
|
// import { Button } from '@pixi/ui';
|
|
|
|
|
|
|
|
export default defineWindow( |
|
|
|
@ -18,9 +18,12 @@ export default defineWindow( |
|
|
|
const btn = new Button({ |
|
|
|
text: "加载中", |
|
|
|
position: () => Position.get("center", "center"), |
|
|
|
onClick: () => { |
|
|
|
console.log("Loading button clicked"); |
|
|
|
} |
|
|
|
}); |
|
|
|
btn._comp.zIndex = 111111 |
|
|
|
this.stage.addChild(btn._comp); |
|
|
|
this.stage.addChild(btn.getView()); |
|
|
|
this.assets = await loadAsset("load-screen", (progress: number) => { |
|
|
|
console.log(progress); |
|
|
|
btn.textObj.text = "进度:" + progress |
|
|
|
@ -65,13 +68,13 @@ export default defineWindow( |
|
|
|
bg: this.assets["btn-bg"], |
|
|
|
pressBg: this.assets["btn-bg-press"], |
|
|
|
position: () => Position.get("center", "center", { y: 200, x: 0 }), |
|
|
|
click: () => { |
|
|
|
onClick: () => { |
|
|
|
this.changeStage("welcome", { isHolderLast: false }) |
|
|
|
// this.pixie.gotoAndPlay(0);
|
|
|
|
// this.startBtn.textObj.text = "1111111111111111111111111111111111111"
|
|
|
|
} |
|
|
|
}) |
|
|
|
allChild.push(this.startBtn._comp) |
|
|
|
allChild.push(this.startBtn.getView()) |
|
|
|
// console.log(button);
|
|
|
|
|
|
|
|
// this.startBtn = Button({
|
|
|
|
@ -137,7 +140,7 @@ export default defineWindow( |
|
|
|
console.log("onUnLoad loading"); |
|
|
|
} |
|
|
|
|
|
|
|
update(dt: number, name: string, ticker: Ticker) { |
|
|
|
update(_dt: number, _name: string, ticker: Ticker) { |
|
|
|
if (this.pixie) { |
|
|
|
this.pixie.update(ticker) |
|
|
|
} |
|
|
|
|