封面标题自适应

This commit is contained in:
草莓 2024-11-30 18:34:17 +08:00
parent 603959250c
commit 2a8e137baf
3 changed files with 12 additions and 2 deletions

View File

@ -19,6 +19,8 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"images": [
"HPGaugeEnemy_A.png",
"HPGaugeEnemy_B.png",
"background.png",
"backgroundvertical.png",
"bear.png",
"bg.jpg",
"bg2.jpg",
@ -135,7 +137,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"startBgm": null,
"styles": {
"startBackground": "project/images/background.png",
"startVerticalBackground": "project/images/background.png",
"startVerticalBackground": "project/images/backgroundvertical.png",
"startLogoStyle": "color: black",
"startButtonsStyle": "background-color: #000000; opacity: 0.45; color: #FFFFFF; border: #FFFFFF 2px solid; caret-color: #FFD700;",
"statusLeftBackground": "url(project/materials/ground.png) repeat",

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

View File

@ -1933,7 +1933,15 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
main.dom.startBackground.setAttribute('__src__', startBackground);
main.dom.startBackground.src = startBackground;
}
}
const span = document.getElementById("startButtons").getElementsByTagName('span');
let font = GAMEVIEW_WIDTH / 100 * core.domStyle.scale
if (core.domStyle.isVertical) font = GAMEVIEW_WIDTH_VERTICAL * 2 / 100 * core.domStyle.scale
core.dom.playGame.style.fontSize = font + "px"
core.dom.loadGame.style.fontSize = font + "px"
core.dom.replayGame.style.fontSize = font + "px"
core.dom.startButtonGroup.style.padding = font * 0.3 + "px 25px"
}
const _resize_canvas = function (obj) { //自适应画布
main.dom.outerBackground.style.width = obj.totalWidth + 'px';
main.dom.outerBackground.style.height = obj.totalHeight + 'px';