diff --git a/assets/characters/demon/demon_thumb.png b/assets/characters/demon/demon_thumb.png new file mode 100644 index 0000000..3c0cbea Binary files /dev/null and b/assets/characters/demon/demon_thumb.png differ diff --git a/assets/characters/dragon/dragon_thumb.png b/assets/characters/dragon/dragon_thumb.png new file mode 100644 index 0000000..09a632a Binary files /dev/null and b/assets/characters/dragon/dragon_thumb.png differ diff --git a/assets/characters/dwarf/dwarf_thumb.png b/assets/characters/dwarf/dwarf_thumb.png new file mode 100644 index 0000000..137d2ce Binary files /dev/null and b/assets/characters/dwarf/dwarf_thumb.png differ diff --git a/assets/characters/elf/elf_thumb.png b/assets/characters/elf/elf_thumb.png new file mode 100644 index 0000000..9bf2ef2 Binary files /dev/null and b/assets/characters/elf/elf_thumb.png differ diff --git a/assets/characters/human/human_thumb.png b/assets/characters/human/human_thumb.png new file mode 100644 index 0000000..fffa74e Binary files /dev/null and b/assets/characters/human/human_thumb.png differ diff --git a/assets/characters/undead/undead_thumb.png b/assets/characters/undead/undead_thumb.png new file mode 100644 index 0000000..0fe9107 Binary files /dev/null and b/assets/characters/undead/undead_thumb.png differ diff --git a/world.html b/world.html index 74a3820..01bb233 100644 --- a/world.html +++ b/world.html @@ -751,7 +751,7 @@ body { background: #0a0e17; overflow: hidden; font-family: 'Microsoft YaHei', sa .mv-cell.active { background: rgba(255,213,79,.14); border-color: #ffd54f; box-shadow: 0 0 10px rgba(255,213,79,.45); } .mv-cell .mv-ico { font-size: 30px; line-height: 1; pointer-events: none; } .mv-cell .mv-ico-img { width: 44px; height: 44px; object-fit: contain; pointer-events: none; border-radius: 6px; } -.mv-cell .mv-ico-char { width: 44px; height: 44px; background-repeat: no-repeat; background-position: center 0; background-size: auto 100%; pointer-events: none; border-radius: 6px; image-rendering: pixelated; } +.mv-cell .mv-ico-char { width: 44px; height: 44px; background-repeat: no-repeat; background-position: 0 0; background-size: auto 100%; pointer-events: none; border-radius: 6px; image-rendering: pixelated; } .mv-cell .mv-nm { font-size: 11px; color: #9fb3c8; pointer-events: none; } .mv-cost { font-size: 10px; color: #ffd54f; pointer-events: none; font-weight: 600; } .mv-cost.free { color: #7fdca0; } @@ -7663,8 +7663,17 @@ function microRenderBuildPanel() { const items = visibleInCat(microBuildCat); gridEl.innerHTML = items.length ? items.map(it => { let ico; - if (it.isChar && it.sprite) { - ico = `
`; + if (it.isChar) { + // 生物卡片:优先用 thumb(单帧图标),避免精灵表(288×64 六帧横排)在 44×44 容器里露出多帧 + const thumb = it.icon; + const hasThumb = typeof thumb === 'string' && /\.(png|webp|jpg|jpeg)(\?.*)?$/i.test(thumb); + if (hasThumb) { + ico = ``; + } else { + // 无 thumb 时用精灵表第一帧:精灵表 288×64(6帧×48),容器 44×44 + // background-size 按高度缩放 + background-position 锚定左上角只露第1帧 + ico = `
`; + } } else { const isImg = typeof it.icon === 'string' && /\.(png|webp|jpg|jpeg)(\?.*)?$/i.test(it.icon); ico = isImg ? `` : `${it.icon}`;