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