封面修改

This commit is contained in:
sakuya 2024-12-01 17:42:24 +08:00
parent 87a14348da
commit dd7fd6920a
4 changed files with 71 additions and 12 deletions

File diff suppressed because one or more lines are too long

View File

@ -202,7 +202,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"title": "秽翼的尤斯蒂娅", "title": "秽翼的尤斯蒂娅",
"name": "Eustia", "name": "Eustia",
"version": "鸽子窝造塔小队", "version": "鸽子窝造塔小队",
"floorId": "MT0", "floorId": "jiuguan",
"hero": { "hero": {
"image": "hero.png", "image": "hero.png",
"animate": false, "animate": false,
@ -225,7 +225,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
}, },
"loc": { "loc": {
"direction": "up", "direction": "up",
"x": 6, "x": 4,
"y": 9 "y": 9
}, },
"flags": { "flags": {

View File

@ -63,5 +63,11 @@ main.floors.MT9=
"fgmap": [ "fgmap": [
], ],
"areas": "下层" "areas": "下层",
"bg2map": [
],
"fg2map": [
]
} }

View File

@ -8647,6 +8647,8 @@ core.plugin.animate = {
CGUI.style.transform = "translate(-50%,-50%)" CGUI.style.transform = "translate(-50%,-50%)"
const ctx = CGUI.getContext("2d"); const ctx = CGUI.getContext("2d");
main.dom.CGUI = CGUI; main.dom.CGUI = CGUI;
let page = 0; // 当前页面变量
let select = 'view'; // 'view'为浏览模式,'zoom'为放大模式
CGUI.onclick = function (e) { CGUI.onclick = function (e) {
try { try {
e.preventDefault(); e.preventDefault();
@ -8661,6 +8663,7 @@ core.plugin.animate = {
} }
} }
function drawImage(name, image, x, y, w, h, x1, y1, w1, h1, angle, reverse) { function drawImage(name, image, x, y, w, h, x1, y1, w1, h1, angle, reverse) {
// 检测文件名以 :x, :y, :o 结尾,表示左右翻转,上下翻转和中心翻转 // 检测文件名以 :x, :y, :o 结尾,表示左右翻转,上下翻转和中心翻转
@ -8779,25 +8782,75 @@ core.plugin.animate = {
core.clearMap(ctx) core.clearMap(ctx)
core.restart(); core.restart();
} }
if (select === 'view') {
// 浏览模式,点击切换页面
page = (page + 1) % main.core.ui.CG.UIMx.length;
main.core.ui.CG.update();
} else if (select === 'zoom') {
// 放大模式,点击清空画布重绘当前页面
core.clearMap(ctx);
main.core.ui.CG.drawUI();
}
} }
drawUI() { drawUI() {
core.clearMap(CGUI) core.clearMap(CGUI)
if (!core?.material?.images?.images['winskin1.png']) return if (!core?.material?.images?.images['winskin1.png']) return
if (core.domStyle.isVertical) { //竖屏 if (core.domStyle.isVertical) { //竖屏
core.drawWindowSkin('winskin1.png', ctx, 0, 0, 1248, 2028);
core.drawWindowSkin('winskin1.png', ctx, 0, 0, 1248, 2028)
core.setTextAlign(ctx, 'center'); core.setTextAlign(ctx, 'center');
core.fillRoundRect(ctx, 45 - 6, 45 - 6, 120 + 12, 120 + 12, 6, '#444444'); core.fillRoundRect(ctx, 45 - 6, 45 - 6, 120 + 12, 80 + 12, 6, '#444444');
core.strokeRoundRect(ctx, 45 - 12, 45 - 12, 120 + 24, 120 + 24, 12, "#444444", 3) core.strokeRoundRect(ctx, 45 - 12, 45 - 12, 120 + 24, 80 + 24, 12, "#444444", 3);
core.fillText(ctx, '离开', 100, 110, '#FFFFFF', core.ui._buildFont(33, true)) core.fillText(ctx, '离开', 100, 110, '#FFFFFF', core.ui._buildFont(33, true));
// 添加向上翻页和向下翻页的按钮
core.fillRoundRect(ctx, 100 - 6, 100 - 6, 120 + 12, 120 + 12, 6, '#444444');
core.strokeRoundRect(ctx, 100 - 12, 100 - 12, 120 + 24, 120 + 120, 12, "#444444", 3);
core.fillText(ctx, '向上翻页', 100, 250, '#FFFFFF', core.ui._buildFont(24, true));
core.fillText(ctx, '向下翻页', 100, 1500, '#FFFFFF', core.ui._buildFont(24, true));
// 添加3*2个4:3的画框
for (let i = 0; i < 3; i++) {
for (let j = 0; j < 2; j++) {
core.strokeRect(ctx, 200 + j * 200, 300 + i * 300, 160, 120, "#FFFFFF", 2);
core.fillRect(ctx, 200 + j * 200, 300 + i * 300, 160, 120, '#FFFFFF');
}
}
// 添加浏览模式和CG模式的字样
core.fillText(ctx, '浏览模式', 400, 180, '#FFFFFF', core.ui._buildFont(24, true));
core.fillText(ctx, 'CG模式', 1200, 180, '#FFFFFF', core.ui._buildFont(24, true));
} else { //横屏 } else { //横屏
ctx.canvas.width = 2028; ctx.canvas.width = 2028;
ctx.canvas.height = 1248; ctx.canvas.height = 1248;
core.drawWindowSkin('winskin1.png', ctx, 0, 0, 2028, 1248) core.drawWindowSkin('winskin1.png', ctx, 0, 0, 2028, 1248);
core.setTextAlign(ctx, 'center'); core.setTextAlign(ctx, 'center');
core.fillRoundRect(ctx, 45 - 6, 45 - 6, 120 + 12, 120 + 12, 6, '#444444'); core.fillRoundRect(ctx, 45 - 6, 45 - 6, 120 + 12, 120 + 12, 6, '#444444');
core.strokeRoundRect(ctx, 45 - 12, 45 - 12, 120 + 24, 120 + 24, 12, "#444444", 3) core.strokeRoundRect(ctx, 45 - 12, 45 - 12, 120 + 24, 120 + 24, 12, "#444444", 3);
core.fillText(ctx, '离开', 100, 110, '#FFFFFF', core.ui._buildFont(33, true)) core.fillText(ctx, '离开', 100, 110, '#FFFFFF', core.ui._buildFont(33, true));
// 添加向上翻页和向下翻页的按钮
core.fillRoundRect(ctx, 45 - 6, 350 - 6, 120 + 12, 120 + 12, 6, '#444444');
core.strokeRoundRect(ctx, 45 - 12, 350 - 12, 120 + 24, 120 + 24, 12, "#444444", 3);
core.fillText(ctx, '向上翻页', 100, 400, '#FFFFFF', core.ui._buildFont(24, true));
core.fillRoundRect(ctx, 45 - 6, 850 - 6, 120 + 12, 120 + 12, 6, '#444444');
core.strokeRoundRect(ctx, 45 - 12, 850 - 12, 120 + 24, 120 + 24, 12, "#444444", 3);
core.fillText(ctx, '向下翻页', 100, 900, '#FFFFFF', core.ui._buildFont(24, true));
// 添加3*2个4:3的画框
for (let i = 0; i < 2; i++) {
for (let j = 0; j < 6; j++) {
core.fillRect(ctx, 200 + j * 300, 350 + i * 450, 240, 160, '#FFFFFF');
core.strokeRect(ctx, 200 + j * 300, 350 + i * 450, 240, 160, "#444444", 2);
}
}
// 添加浏览模式和CG模式的字样
core.fillRoundRect(ctx, 550 - 6, 45 - 6, 120 + 12, 120 + 12, 6, '#444444');
core.strokeRoundRect(ctx, 550 - 12, 45 - 12, 120 + 24, 120 + 24, 12, "#444444", 3);
core.fillText(ctx, '浏览模式', 600, 100, '#FFFFFF', core.ui._buildFont(24, true));
core.fillRoundRect(ctx, 1150 - 6, 45 - 6, 120 + 12, 120 + 12, 6, '#444444');
core.strokeRoundRect(ctx, 1150 - 12, 45 - 12, 120 + 24, 120 + 24, 12, "#444444", 3);
core.fillText(ctx, 'CG模式', 1200, 100, '#FFFFFF', core.ui._buildFont(24, true));
} }