Module:Sprite/Item/doc
Appearance
< Module:Sprite | Item
This is the documentation page for Module:Sprite/Item
This is the documentation page for Module:Sprite/Item.
A pure data module (no functions): it returns a Lua table describing the Sanko item sprite atlas. It is consumed by Module:Sprite via mw.loadData('Module:Sprite/Item') and, through that, by Template:ItemSprite and Template:Sprite.
Table layout
| Key | Meaning |
|---|---|
url |
Atlas asset path (/w/sanko-assets/Sanko_item_atlas.svg). Not read by Module:Sprite; the image is applied by the .sanko-sprite site CSS.
|
image |
Wiki file name of the atlas (Sanko item atlas.svg).
|
cell |
Sprite cell size in pixels (32). |
columns |
Atlas columns (4). |
width, height |
Native atlas dimensions in pixels (128 × 1056). |
items |
Map of exact item name → { item_id, x, y }, where x/y are the sprite's pixel offsets in the atlas at native size.
|
Usage
local itemData = mw.loadData('Module:Sprite/Item')
local entry = itemData.items['Bronze Axe']
-- entry = { item_id = 4, x = 96, y = 0 }
Notes and sharp edges
- Keys are exact display names — case, spacing, and punctuation sensitive.
['Bronze Axe']works;['bronze axe']renders the missing-sprite placeholder. item_idvalues track the game item catalog and are not contiguous (gaps exist, e.g. 29 and 98–100 are unassigned here); Module:Sprite only usesx/y, notitem_id.NA,NA2,NA3are placeholder atlas cells, not real items.- When adding an entry, its
x/ymust match the sprite's actual cell in the atlas image (columns advance x by 32, rows advance y by 32), andheightmust cover any new rows. Item IDs and catalog names are bot/API-owned fields per the style guide — keep them in sync with the catalog rather than inventing values. - Loaded with
mw.loadData, so the table must stay static data only (no functions, no metatables).