2 changed files with 48 additions and 3 deletions
@ -0,0 +1,44 @@ |
|||
import { logger } from "@/core/Logger"; |
|||
import { SceneType } from "@/enums/SceneType"; |
|||
import { BaseScene } from "@/scene/BaseScene"; |
|||
import { Assets, Container } from "pixi.js"; |
|||
|
|||
export default class Global extends BaseScene { |
|||
stage: Container = new Container(); |
|||
|
|||
constructor() { |
|||
super("00_global", SceneType.Resident); |
|||
logger.debug("Resident scene 00_global constructed"); |
|||
} |
|||
|
|||
async loadBundle(): Promise<void> { |
|||
Assets.add({ alias: "btn-bga", src: "/assets/images/button_square_depth_gloss.png" }); |
|||
Assets.add({ alias: "btn-bg-press", src: "/assets/images/button_square_depth_gradient.png" }); |
|||
await Assets.load("btn-bga"); |
|||
await Assets.load("btn-bg-press"); |
|||
} |
|||
|
|||
async layout(): Promise<void> { |
|||
this.stage.sortableChildren = true; |
|||
this.stage.zIndex = 9999; |
|||
// const btnBg = Assets.get<Texture>("btn-bga");
|
|||
// const btnBgPress = Assets.get<Texture>("btn-bg-press");
|
|||
// this.btn = new Button({
|
|||
// text: "全局",
|
|||
// bg: btnBg,
|
|||
// pressBg: btnBgPress,
|
|||
// position: () => position.get("center", "center", { y: 100, x: 0 }),
|
|||
// onClick: () => {
|
|||
// console.log("Button clicked");
|
|||
// },
|
|||
// });
|
|||
// this.stage.addChild(this.btn.getView());
|
|||
} |
|||
|
|||
onLoad(): void { |
|||
logger.info("Resident scene 00_global onLoad"); |
|||
} |
|||
|
|||
onUnLoad(): void { |
|||
} |
|||
} |
|||
Loading…
Reference in new issue