适配问题
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"resolution": {
|
||||
"designWidth": 1920,
|
||||
"designHeight": 1080,
|
||||
"designWidth": 1080,
|
||||
"designHeight": 1920,
|
||||
"scaleMode": "fixedauto",
|
||||
"backgroundColor": "rgba(245, 247, 251, 1)"
|
||||
},
|
||||
"modules": {
|
||||
|
||||
@@ -7,13 +7,11 @@ Laya.addBeforeInitCallback((stageConfig) => {
|
||||
if (window.innerWidth > window.innerHeight) {
|
||||
stageConfig.designWidth = config.DESIGN_HEIGHT
|
||||
stageConfig.designHeight = config.DESIGN_WIDTH
|
||||
stageConfig.scaleMode = "fixedauto"
|
||||
config.H_SCREEN = true
|
||||
}
|
||||
else {
|
||||
stageConfig.designWidth = config.DESIGN_WIDTH
|
||||
stageConfig.designHeight = config.DESIGN_HEIGHT
|
||||
stageConfig.scaleMode = "fixedheight"
|
||||
config.H_SCREEN = false
|
||||
}
|
||||
console.log(`横屏=${config.H_SCREEN}`)
|
||||
|
||||
Reference in New Issue
Block a user