27 lines
843 B
TypeScript
27 lines
843 B
TypeScript
|
|
import { config } from "./constants/config"
|
|
|
|
Laya.addBeforeInitCallback((stageConfig) => {
|
|
console.log(`window innerWidth=${window.innerWidth} innerHeight=${window.innerHeight}`)
|
|
console.log(`stageConfig designWidth=${stageConfig.designWidth} designWidth=${stageConfig.designHeight}`)
|
|
// if (window.innerWidth > window.innerHeight) {
|
|
// stageConfig.designWidth = 1920
|
|
// stageConfig.designHeight = 1080
|
|
// stageConfig.scaleMode = "fixedwidth"
|
|
// config.H_SCREEN = true
|
|
// }
|
|
// else {
|
|
// stageConfig.designWidth = 1080
|
|
// stageConfig.designHeight = 1920
|
|
// stageConfig.scaleMode = "fixedheight"
|
|
// config.H_SCREEN = false
|
|
// }
|
|
// console.log(`横屏=${config.H_SCREEN}`)
|
|
})
|
|
|
|
export async function main() {
|
|
console.log("entry")
|
|
// 加载场景并打开场景
|
|
Laya.Scene.open("Scene.ls")
|
|
}
|