Compare commits

..

3 Commits

Author SHA1 Message Date
6891062351 fix: enemy48 显示错误 2025-09-30 13:52:41 +08:00
8f4f8d86a9 chore: 调整抗锯齿设置 2025-09-30 13:37:00 +08:00
61e09f6395 fix: 部分缩放条件下模糊 2025-09-30 13:33:39 +08:00
6 changed files with 10 additions and 6 deletions

View File

@ -1026,6 +1026,8 @@ export class Layer extends Container<ELayerEvent> {
this.autotiles = {}; this.autotiles = {};
this.block.size(width, height); this.block.size(width, height);
this.block.clearAllCache(); this.block.clearAllCache();
this.bigImages.clear();
this.moving.clear();
for (const ex of this.extend.values()) { for (const ex of this.extend.values()) {
ex.onMapResize?.(this, width, height); ex.onMapResize?.(this, width, height);
@ -1160,7 +1162,7 @@ export class Layer extends Container<ELayerEvent> {
this.floorImage.forEach(v => { this.floorImage.forEach(v => {
if (v.disable) return; if (v.disable) return;
const { x, y } = v; const { x, y } = v;
ctx.fillRect(0, 0, 480, 480); ctx.fillRect(0, 0, MAP_WIDTH, MAP_HEIGHT);
ctx.drawImage(images[v.name], x, y); ctx.drawImage(images[v.name], x, y);
}); });
} }

View File

@ -255,6 +255,7 @@ const MainScene = defineComponent(() => {
width={MAIN_WIDTH} width={MAIN_WIDTH}
height={MAIN_HEIGHT} height={MAIN_HEIGHT}
noanti noanti
nocache
> >
<LeftStatusBar <LeftStatusBar
loc={[0, 0, STATUS_BAR_WIDTH, STATUS_BAR_HEIGHT]} loc={[0, 0, STATUS_BAR_WIDTH, STATUS_BAR_HEIGHT]}

View File

@ -179,13 +179,13 @@ export const ViewMap = defineComponent<ViewMapProps>(props => {
const renderTop = (canvas: MotaOffscreenCanvas2D) => { const renderTop = (canvas: MotaOffscreenCanvas2D) => {
const ctx = canvas.ctx; const ctx = canvas.ctx;
ctx.fillStyle = getTopGradient(ctx); ctx.fillStyle = getTopGradient(ctx);
ctx.fillRect(0, 0, 480, 64); ctx.fillRect(0, 0, MAP_WIDTH, 64);
}; };
const renderBottom = (canvas: MotaOffscreenCanvas2D) => { const renderBottom = (canvas: MotaOffscreenCanvas2D) => {
const ctx = canvas.ctx; const ctx = canvas.ctx;
ctx.fillStyle = getBottomGradient(ctx); ctx.fillStyle = getBottomGradient(ctx);
ctx.fillRect(0, 0, 480, 64); ctx.fillRect(0, 0, MAP_HEIGHT, 64);
}; };
const enterTop = () => (topAlpha.value = 0.9); const enterTop = () => (topAlpha.value = 0.9);

View File

@ -429,7 +429,6 @@ export abstract class RenderItem<E extends ERenderItemEvent = ERenderItemEvent>
const ctx = canvas.ctx; const ctx = canvas.ctx;
ctx.save(); ctx.save();
canvas.setAntiAliasing(this.antiAliasing);
if (this.type === 'static') transformCanvas(canvas, tran); if (this.type === 'static') transformCanvas(canvas, tran);
ctx.filter = this.filter; ctx.filter = this.filter;
ctx.globalAlpha = this.alpha; ctx.globalAlpha = this.alpha;
@ -442,8 +441,10 @@ export abstract class RenderItem<E extends ERenderItemEvent = ERenderItemEvent>
this.cacheDirty = false; this.cacheDirty = false;
} }
canvas.setAntiAliasing(false);
canvas.ctx.drawImage(this.cache.canvas, ax, ay, width, height); canvas.ctx.drawImage(this.cache.canvas, ax, ay, width, height);
} else { } else {
canvas.setAntiAliasing(this.antiAliasing);
canvas.ctx.translate(ax, ay); canvas.ctx.translate(ax, ay);
this.render(canvas, tran); this.render(canvas, tran);
this.cacheDirty = false; this.cacheDirty = false;

View File

@ -155,7 +155,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
return current[0]; return current[0];
}).toString(), }).toString(),
"_docs": "绑定贴图", "_docs": "绑定贴图",
"_data": "该怪物绑定的怪物贴图,用法详见文档" "_data": "绑定贴图暂时不不支持,预计在 2.B.1 添加支持"
}, },
"hp": { "hp": {
"_leaf": true, "_leaf": true,

View File

@ -8,7 +8,7 @@ main.floors.sample0=
"canUseQuickShop": true, "canUseQuickShop": true,
"defaultGround": "ground", "defaultGround": "ground",
"images": [], "images": [],
"bgm": "bgm.opus", "bgm": "bgm.mp3",
"ratio": 1, "ratio": 1,
"map": [ "map": [
[ 0, 0,220, 0, 0, 20, 87, 3, 58, 59, 60, 61, 64], [ 0, 0,220, 0, 0, 20, 87, 3, 58, 59, 60, 61, 64],