字体描边

This commit is contained in:
草莓 2024-12-14 10:50:28 +08:00
parent 68da490685
commit 43c6f610a3

View File

@ -1918,7 +1918,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
const TOOL_ICON_OUTER_SIZE = 34 * 3;
const TEXT_COLOR = '#111111'; //默认文字颜色
const TEXT_COLOR = '#FFFFFF'; //默认文字颜色
const globalAlpha = 0.7; //默认底框透明度
const FORCE_COUNTABLE_ITEMS = ["centerFly"]; //常态显示数量的非永久道具如果道具不在此数组中则只有道具多余1时显示数量
@ -2223,7 +2223,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
// 四舍五入
core.status.hero[item] = Math.round(core.status.hero[item]);
// 大数据格式化
core.fillText("outerUI", core.getRealStatus(item), baseX, curh, TEXT_COLOR);
core.fillBoldText("outerUI", core.getRealStatus(item), baseX, curh, TEXT_COLOR, "#000000");
curh += 24 * 3;
if (curh > 130 * 3 && core.domStyle.isVertical) {
curh = 24 * 3;
@ -2237,7 +2237,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.setFont("outerUI", 'bold 42px Verdana');
if (updatedFloorTitle) {
core.fillText("outerUI", updatedFloorTitle, 60 * 3, 22 * 3, TEXT_COLOR);
core.fillBoldText("outerUI", updatedFloorTitle, 60 * 3, 22 * 3, TEXT_COLOR, '#000000');
}
drawStatusList(96 * 3, 46 * 3);
} else {
@ -2245,7 +2245,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.setFont("outerUI", 'bold 48px Verdana');
if (updatedFloorTitle) {
core.fillText("outerUI", updatedFloorTitle, 62 * 3, 41 * 3, TEXT_COLOR);
core.fillBoldText("outerUI", updatedFloorTitle, 62 * 3, 41 * 3, TEXT_COLOR, '#000000');
}
drawStatusList(110 * 3, 93 * 3);
}
@ -8250,7 +8250,7 @@ core.plugin.animate = {
core.fillRect(ctx, sx, sy, sw, sh, '#000')
core.strokeRect(ctx, sx, sy, sw, sh, '#fff', 5)
core.setTextAlign('outerUI', 'center')
core.fillText(ctx, core.status.maps[center].areas, sx + sw * 3 / 8, sy - 10, '#FFFFFF', 'bold 42px Verdana')
core.fillBoldText(ctx, core.status.maps[center].areas, sx + sw * 3 / 8, sy - 10, '#FFFFFF', '#000000', 'bold 42px Verdana')
const locs = info.locs
for (const id in locs) {
const loc = locs[id];
@ -8335,52 +8335,52 @@ core.plugin.animate = {
const i = areas.findIndex(v => v.name === core.status.maps[floorId].areas)
core.fillRoundRect('ui', 15 - 2, 15 - 2, 35 + 4, 35 + 4, 4, '#444444');
core.strokeRoundRect('ui', 15 - 4, 15 - 4, 35 + 8, 35 + 8, 4, "#444444", 1)
core.fillText('ui', '当前', 13 + 20, 17 + 20, '#FFFFFF', this._buildFont(18, true))
core.fillBoldText('ui', '当前', 13 + 20, 17 + 20, '#FFFFFF', '#000000', this._buildFont(18, true))
core.fillRoundRect('ui', 15 - 2, 15 - 2 + 35 + 8 + size + 8 - 54, 35 + 4, 35 + 4, 4, '#444444');
core.strokeRoundRect('ui', 15 - 4, 15 - 4 + 35 + 8 + size + 8 - 54, 35 + 8, 35 + 8, 4, "#444444", 1)
if (!core.status.maps[core.floorIds[page]].canFlyTo || !core.hasVisitedFloor(core.floorIds[page])) {
core.fillText('ui', '预览', 13 + 20, 17 + 20 + 35 + 8 + size + 8 - 54, '#909090', this._buildFont(18, true))
core.fillBoldText('ui', '预览', 13 + 20, 17 + 20 + 35 + 8 + size + 8 - 54, '#909090', '#000000', this._buildFont(18, true))
} else {
core.fillText('ui', '传送', 13 + 20, 17 + 20 + 35 + 8 + size + 8 - 54, '#909090', this._buildFont(18, true))
core.fillBoldText('ui', '传送', 13 + 20, 17 + 20 + 35 + 8 + size + 8 - 54, '#909090', '#000000', this._buildFont(18, true))
}
core.fillRoundRect('ui', 15 - 4 + size - 2 + 45, 15 - 2 + size - 4 + 45, 35 + 4, 35 + 4, 4, '#444444');
core.strokeRoundRect('ui', 15 - 4 + size - 4 + 45, 15 - 4 + size - 4 + 45, 35 + 8, 35 + 8, 4, "#444444", 1)
core.fillText('ui', '离开', 15 - 4 + size - 4 + 45 + 22, 15 - 4 + size - 4 + 45 + 26, '#FFFFFF', this._buildFont(18, true))
core.fillBoldText('ui', '离开', 15 - 4 + size - 4 + 45 + 22, 15 - 4 + size - 4 + 45 + 26, '#FFFFFF', '#000000', this._buildFont(18, true))
core.fillRoundRect('ui', 15 + 44 - 2, 15 - 2, size + 4 - 58, 35 + 4, 4, '#444444');
core.strokeRoundRect('ui', 15 + 44 - 4, 15 - 4, size + 8 - 58, 35 + 8, 4, "#444444", 1)
if (mapdir.includes("up")) {
core.fillText('ui', '北▲', 30 + 145 + 10, 17 + 20, '#FFFFFF', this._buildFont(18, true))
core.fillBoldText('ui', '北▲', 30 + 145 + 10, 17 + 20, '#FFFFFF', '#000000', this._buildFont(18, true))
} else {
core.fillText('ui', '北▲', 30 + 145 + 10, 17 + 20, '#909090', this._buildFont(18, true))
core.fillBoldText('ui', '北▲', 30 + 145 + 10, 17 + 20, '#909090', '#000000', this._buildFont(18, true))
}
core.fillRoundRect('ui', 15 - 2, 59 - 2, 35 + 4, size + 4 - 58, 4, '#444444');
core.strokeRoundRect('ui', 15 - 4, 59 - 4, 35 + 8, size + 8 - 58, 4, "#444444", 1)
if (mapdir.includes("left")) {
core.fillText('ui', '西', 15 + 17, 25 + 150, '#FFFFFF', this._buildFont(18, true))
core.fillText('ui', '◀', 15 + 17, 45 + 150, '#FFFFFF', this._buildFont(18, true))
core.fillBoldText('ui', '西', 15 + 17, 25 + 150, '#FFFFFF', '#000000', this._buildFont(18, true))
core.fillBoldText('ui', '◀', 15 + 17, 45 + 150, '#FFFFFF', '#000000', this._buildFont(18, true))
} else {
core.fillText('ui', '西', 15 + 17, 25 + 150, '#909090', this._buildFont(18, true))
core.fillText('ui', '◀', 15 + 17, 45 + 150, '#909090', this._buildFont(18, true))
core.fillBoldText('ui', '西', 15 + 17, 25 + 150, '#909090', '#000000', this._buildFont(18, true))
core.fillBoldText('ui', '◀', 15 + 17, 45 + 150, '#909090', '#000000', this._buildFont(18, true))
}
core.fillRoundRect('ui', 15 + 44 - 2, 15 - 2 + size - 4, size + 4 - 58, 35 + 4, 4, '#444444');
core.strokeRoundRect('ui', 15 + 44 - 4, 15 - 4 + size - 4, size + 8 - 58, 35 + 8, 4, "#444444", 1)
if (mapdir.includes("down")) {
core.fillText('ui', '南▼', 30 + 145 + 10, 17 + 20 + size - 4, '#FFFFFF', this._buildFont(18, true))
core.fillBoldText('ui', '南▼', 30 + 145 + 10, 17 + 20 + size - 4, '#FFFFFF', '#000000', this._buildFont(18, true))
} else {
core.fillText('ui', '南▼', 30 + 145 + 10, 17 + 20 + size - 4, '#909090', this._buildFont(18, true))
core.fillBoldText('ui', '南▼', 30 + 145 + 10, 17 + 20 + size - 4, '#909090', '#000000', this._buildFont(18, true))
}
core.fillRoundRect('ui', 15 - 2 + size - 4, 59 - 2, 35 + 4, size + 4 - 58, 4, '#444444');
core.strokeRoundRect('ui', 15 - 4 + size - 4, 59 - 4, 35 + 8, size + 8 - 58, 4, "#444444", 1)
if (mapdir.includes("right")) {
core.fillText('ui', '东', 15 + 17 + size - 4, 25 + 150, '#FFFFFF', this._buildFont(18, true))
core.fillText('ui', '▶', 15 + 17 + size - 4, 45 + 150, '#FFFFFF', this._buildFont(18, true))
core.fillBoldText('ui', '东', 15 + 17 + size - 4, 25 + 150, '#FFFFFF', '#000000', this._buildFont(18, true))
core.fillBoldText('ui', '▶', 15 + 17 + size - 4, 45 + 150, '#FFFFFF', '#000000', this._buildFont(18, true))
} else {
core.fillText('ui', '东', 15 + 17 + size - 4, 25 + 150, '#909090', this._buildFont(18, true))
core.fillText('ui', '▶', 15 + 17 + size - 4, 45 + 150, '#909090', this._buildFont(18, true))
core.fillBoldText('ui', '东', 15 + 17 + size - 4, 25 + 150, '#909090', '#000000', this._buildFont(18, true))
core.fillBoldText('ui', '▶', 15 + 17 + size - 4, 45 + 150, '#909090', '#000000', this._buildFont(18, true))
}
core.fillRoundRect('ui', 60 - 2, 60 - 2, size - 58 + 4, size - 58 + 4, 4, '#444444');
core.strokeRoundRect('ui', 60 - 4, 60 - 4, size - 58 + 8, size - 58 + 8, 4, "#444444", 1)
@ -8390,35 +8390,35 @@ core.plugin.animate = {
core.fillRoundRect('ui', 15 + 44 - 2, 60 - 2 + size - 4, size + 4 - 58, 35 + 4, 4, '#444444');
core.strokeRoundRect('ui', 15 + 44 - 4, 60 - 4 + size - 4, size + 8 - 58, 35 + 8, 4, "#444444", 1)
core.fillText('ui', core.status.maps[floorId].areas, 30 + 145 + 10, 17 + 65 + size - 4, '#FFFFFF', this._buildFont(18, true))
core.fillBoldText('ui', core.status.maps[floorId].areas, 30 + 145 + 10, 17 + 65 + size - 4, '#FFFFFF', '#000000', this._buildFont(18, true))
core.fillRoundRect('ui', 15 - 2, 60 - 2 + size - 4, 35 + 4, 35 + 4, 4, '#444444');
core.strokeRoundRect('ui', 15 - 4, 60 - 4 + size - 4, 35 + 8, 35 + 8, 4, "#444444", 1)
if (i === 0) {
core.fillText('ui', '◀', 35, 17 + 65 + size - 4, '#909090', this._buildFont(18, true))
core.fillBoldText('ui', '◀', 35, 17 + 65 + size - 4, '#909090', '#000000', this._buildFont(18, true))
} else {
core.fillText('ui', '◀', 35, 17 + 65 + size - 4, '#FFFFFF', this._buildFont(18, true))
core.fillBoldText('ui', '◀', 35, 17 + 65 + size - 4, '#FFFFFF', '#000000', this._buildFont(18, true))
}
core.fillRoundRect('ui', 15 - 2 + size - 4, 60 - 2 + size - 4, 35 + 4, 35 + 4, 4, '#444444');
core.strokeRoundRect('ui', 15 - 4 + size - 4, 60 - 4 + size - 4, 35 + 8, 35 + 8, 4, "#444444", 1)
if (i === areas.length - 1) {
core.fillText('ui', '▶', 30 + 300 + 10, 17 + 65 + size - 4, '#909090', this._buildFont(18, true))
core.fillBoldText('ui', '▶', 30 + 300 + 10, 17 + 65 + size - 4, '#909090', '#000000', this._buildFont(18, true))
} else {
core.fillText('ui', '▶', 30 + 300 + 10, 17 + 65 + size - 4, '#FFFFFF', this._buildFont(18, true))
core.fillBoldText('ui', '▶', 30 + 300 + 10, 17 + 65 + size - 4, '#FFFFFF', '#000000', this._buildFont(18, true))
}
core.fillRoundRect('ui', 15 - 2 + size - 4, 15 - 2, 80 + 4, 35 + 4, 4, '#444444');
core.strokeRoundRect('ui', 15 - 4 + size - 4, 15 - 4, 80 + 8, 35 + 8, 4, "#444444", 1)
if (mapdir.includes("upFloor")) {
core.fillText('ui', '上楼', 30 + 320 + 10, 17 + 20, '#FFFFFF', this._buildFont(18, true))
core.fillBoldText('ui', '上楼', 30 + 320 + 10, 17 + 20, '#FFFFFF', '#000000', this._buildFont(18, true))
} else {
core.fillText('ui', '上楼', 30 + 320 + 10, 17 + 20, '#909090', this._buildFont(18, true))
core.fillBoldText('ui', '上楼', 30 + 320 + 10, 17 + 20, '#909090', '#000000', this._buildFont(18, true))
}
core.fillRoundRect('ui', 15 - 2 + size - 4, 15 - 2 + size - 4, 80 + 4, 35 + 4, 4, '#444444');
core.strokeRoundRect('ui', 15 - 4 + size - 4, 15 - 4 + size - 4, 80 + 8, 35 + 8, 4, "#444444", 1)
if (mapdir.includes("downFloor")) {
core.fillText('ui', '下楼', 30 + 320 + 10, 17 + 20 + size - 4, '#FFFFFF', this._buildFont(18, true))
core.fillBoldText('ui', '下楼', 30 + 320 + 10, 17 + 20 + size - 4, '#FFFFFF', '#000000', this._buildFont(18, true))
} else {
core.fillText('ui', '下楼', 30 + 320 + 10, 17 + 20 + size - 4, '#909090', this._buildFont(18, true))
core.fillBoldText('ui', '下楼', 30 + 320 + 10, 17 + 20 + size - 4, '#909090', '#000000', this._buildFont(18, true))
}
core.fillRoundRect('ui', 15 - 2 + size - 4 + 35 + 8, 60 - 2, 37 + 4, (size - 58) / 2 + 4, 4, '#444444');
@ -8430,9 +8430,9 @@ core.plugin.animate = {
core.fillRoundRect('ui', 15 - 2 + size - 4 + 35 + 8, 60 - 2 + (size - 58) / 2 + 8, 37 + 4, 119 + 4, 4, '#444444');
core.strokeRoundRect('ui', 15 - 4 + size - 4 + 35 + 8, 60 - 4 + (size - 58) / 2 + 8, 37 + 8, 119 + 8, 4, "#444444", 1)
if (core.getFlag('showEnemy')) {
fillTextVertical("ui", "关闭漏怪检测", 15 - 4 + size - 4 + 45, 220, '#FFFFFF', 18)
fillTextVertical("ui", "关闭漏怪检测", 15 - 4 + size - 4 + 45, 220, '#FFFFFF', '#000000', 18)
} else {
fillTextVertical("ui", "开启漏怪检测", 15 - 4 + size - 4 + 45, 220, '#FFFFFF', 18)
fillTextVertical("ui", "开启漏怪检测", 15 - 4 + size - 4 + 45, 220, '#FFFFFF', '#000000', 18)
}
//uictx.fillTextVertical(title, 15 - 4 + size - 4 + 35 + 29, 25 + 150)
@ -8440,16 +8440,19 @@ core.plugin.animate = {
}
function fillTextVertical(name, text, x, y, style, fontsize) {
function fillTextVertical(name, text, x, y, style, boldstyle, fontsize) {
const ctx = core.ui.getContextByName(name);
if (!ctx) return;
const canvas = document.createElement('canvas');
const context = canvas.getContext("2d");
const length = text.length
canvas.width = fontsize * 2
canvas.height = fontsize * length * 2
if (style) context.fillStyle = core.arrayToRGBA(style)
if (boldstyle) context.strokeStyle = core.arrayToRGBA(boldstyle)
context.lineWidth = 2;
if (fontsize) context.font = core.ui._buildFont(fontsize, true);
let arrText = text.split('');
@ -8506,6 +8509,7 @@ core.plugin.animate = {
}
context.strokeText(letter, sx, sy);
context.fillText(letter, sx, sy);
// 旋转坐标系还原成初始态
@ -9208,14 +9212,14 @@ core.plugin.animate = {
core.setTextAlign(ctx, 'center');
core.fillRoundRect(ctx, 45 - 6, 45 - 6, 120 + 12, 80 + 12, 6, '#444444');
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.fillBoldText(ctx, '离开', 100, 110, '#FFFFFF', '#000000', core.ui._buildFont(33, true));
// 添加向上翻页和向下翻页的按钮
core.fillRoundRect(ctx, 45 - 6, 400 - 6, 120 + 12, 120 + 12, 6, '#444444');
core.strokeRoundRect(ctx, 45 - 12, 400 - 12, 120 + 24, 120 + 12, 12, "#444444", 3);
core.fillRoundRect(ctx, 45 - 6, 1100 - 6, 120 + 12, 120 + 12, 6, '#444444');
core.strokeRoundRect(ctx, 45 - 12, 1100 - 12, 120 + 24, 120 + 12, 12, "#444444", 3);
core.fillText(ctx, '向上翻页', 100, 450, '#FFFFFF', core.ui._buildFont(24, true));
core.fillText(ctx, '向下翻页', 100, 1150, '#FFFFFF', core.ui._buildFont(24, true));
core.fillBoldText(ctx, '向上翻页', 100, 450, '#FFFFFF', '#000000', core.ui._buildFont(24, true));
core.fillBoldText(ctx, '向下翻页', 100, 1150, '#FFFFFF', '#000000', core.ui._buildFont(24, true));
// 添加3*2个4:3的画框及图片
for (let i = 0; i < 3; i++) {
@ -9244,15 +9248,15 @@ core.plugin.animate = {
core.setTextAlign(ctx, 'center');
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.fillText(ctx, '离开', 100, 110, '#FFFFFF', core.ui._buildFont(33, true));
core.fillBoldText(ctx, '离开', 100, 110, '#FFFFFF', '#000000', 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.fillBoldText(ctx, '向上翻页', 100, 400, '#FFFFFF', '#000000', 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));
core.fillBoldText(ctx, '向下翻页', 100, 900, '#FFFFFF', '#000000', core.ui._buildFont(24, true));
// 添加3*2个4:3的画框
for (let i = 0; i < 2; i++) {
@ -9923,11 +9927,11 @@ core.plugin.animate = {
}
if (core.isPlaying() && !this.WindowSkin) {
core.drawWindowSkin("winskin.png", ctx, 1700, 1100, 192, 96)
core.fillText(ctx, '存 档', 1736, 1166, '#FFFFFF', "bold 48px Verdana")
core.fillBoldText(ctx, '存 档', 1736, 1166, '#FFFFFF', '#000000', "bold 48px Verdana")
core.drawWindowSkin("winskin.png", ctx, 1400, 1100, 192, 96)
core.fillText(ctx, '▶▶', 1456, 1166, '#FFFFFF', "bold 48px Verdana")
core.fillBoldText(ctx, '▶▶', 1456, 1166, '#FFFFFF', '#000000', "bold 48px Verdana")
}
if (this.name) core.fillText(ctx, `${this.name}`, 500, 880, '#FFFFFF', "bold 48px Verdana")
if (this.name) core.fillBoldText(ctx, `${this.name}`, 500, 880, '#FFFFFF', '#000000', "bold 48px Verdana")
if (this.text) {
this.drawTextContent(ctx, this.text, {
left: 500,