mirror of
https://github.com/rh-hideout/pokeemerald-expansion.git
synced 2026-03-21 18:04:50 -05:00
Fix sprite display to show front-facing frame instead of full sheet
The NPC sprite images are horizontal strips with multiple frames. Previously the entire sheet was squeezed into the container, showing all frames at once. Now the image height fills the container with auto width, and overflow:hidden clips to just the first (front-facing) frame. https://claude.ai/code/session_01LgEDXY2DGWvLdHvhmM5Xqy
This commit is contained in:
parent
54f2168d7e
commit
34d9e833db
|
|
@ -2140,7 +2140,7 @@ function getSpriteHtml(graphicsId, size = 32) {
|
|||
const url = getSpriteUrl(graphicsId);
|
||||
const name = (graphicsId || '').replace('OBJ_EVENT_GFX_', '').replace(/_/g, ' ');
|
||||
return `<div class="sprite-container" style="width:${size}px;height:${size}px">
|
||||
<img src="${url}" onerror="this.style.display='none';this.nextElementSibling.style.display='flex'" style="width:${size}px;height:${size}px;image-rendering:pixelated" alt="${escAttr(name)}">
|
||||
<img src="${url}" onerror="this.style.display='none';this.nextElementSibling.style.display='flex'" style="height:${size}px;width:auto;image-rendering:pixelated" alt="${escAttr(name)}">
|
||||
<div class="sprite-fallback" style="display:none;width:${size}px;height:${size}px">${escHtml(name.substring(0, 2).toUpperCase())}</div>
|
||||
</div>`;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1200,7 +1200,7 @@ tbody tr:last-child td { border-bottom: none; }
|
|||
background: var(--bg);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.sprite-fallback {
|
||||
align-items: center;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user