Jump to content

Module:Sprite/Item

From SankoQuest Wiki

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_id values track the game item catalog and are not contiguous (gaps exist, e.g. 29 and 98–100 are unassigned here); Module:Sprite only uses x/y, not item_id.
  • NA, NA2, NA3 are placeholder atlas cells, not real items.
  • When adding an entry, its x/y must match the sprite's actual cell in the atlas image (columns advance x by 32, rows advance y by 32), and height must 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).

return {
    url = '/w/sanko-assets/Sanko_item_atlas.svg',
    image = 'Sanko item atlas.svg',
    cell = 32,
    columns = 4,
    width = 128,
    height = 1056,
    items = {
        ['Amanita'] = { item_id = 1, x = 0, y = 0 },
        ['Cheese'] = { item_id = 2, x = 32, y = 0 },
        ['Baseball'] = { item_id = 3, x = 64, y = 0 },
        ['Bronze Axe'] = { item_id = 4, x = 96, y = 0 },
        ['Iron Axe'] = { item_id = 5, x = 0, y = 32 },
        ['Steel Axe'] = { item_id = 6, x = 32, y = 32 },
        ['Bundle of Sticks'] = { item_id = 7, x = 64, y = 32 },
        ['Log'] = { item_id = 8, x = 96, y = 32 },
        ['Oak Log'] = { item_id = 9, x = 0, y = 64 },
        ['Lighter'] = { item_id = 10, x = 32, y = 64 },
        ['Wooden Shield'] = { item_id = 11, x = 64, y = 64 },
        ['Bronze Short Sword'] = { item_id = 12, x = 96, y = 64 },
        ['Iron Short Sword'] = { item_id = 13, x = 0, y = 96 },
        ['Steel Short Sword'] = { item_id = 14, x = 32, y = 96 },
        ['Bronze Pickaxe'] = { item_id = 15, x = 64, y = 96 },
        ['Iron Pickaxe'] = { item_id = 16, x = 96, y = 96 },
        ['Steel Pickaxe'] = { item_id = 17, x = 0, y = 128 },
        ['Fishing Net'] = { item_id = 18, x = 32, y = 128 },
        ['Raw Brown Trout'] = { item_id = 19, x = 64, y = 128 },
        ['Cooked Brown Trout'] = { item_id = 20, x = 96, y = 128 },
        ['Raw Crawdad'] = { item_id = 21, x = 0, y = 160 },
        ['Cooked Crawdad'] = { item_id = 22, x = 32, y = 160 },
        ['Fishing Rod'] = { item_id = 23, x = 64, y = 160 },
        ['NA'] = { item_id = 24, x = 96, y = 160 },
        ['NA2'] = { item_id = 25, x = 0, y = 192 },
        ['NA3'] = { item_id = 26, x = 32, y = 192 },
        ['Bones'] = { item_id = 27, x = 64, y = 192 },
        ['Small Bones'] = { item_id = 28, x = 96, y = 192 },
        ['Bronze Kiteshield'] = { item_id = 30, x = 0, y = 224 },
        ['Iron Kiteshield'] = { item_id = 31, x = 32, y = 224 },
        ['Steel Kiteshield'] = { item_id = 32, x = 64, y = 224 },
        ['Bronze Shield'] = { item_id = 33, x = 96, y = 224 },
        ['Iron Shield'] = { item_id = 34, x = 0, y = 256 },
        ['Steel Shield'] = { item_id = 35, x = 32, y = 256 },
        ['Bronze 2hd Sword'] = { item_id = 36, x = 64, y = 256 },
        ['Iron 2hd Sword'] = { item_id = 37, x = 96, y = 256 },
        ['Steel 2hd Sword'] = { item_id = 38, x = 0, y = 288 },
        ['Bronze Katana'] = { item_id = 39, x = 32, y = 288 },
        ['Iron Katana'] = { item_id = 40, x = 64, y = 288 },
        ['Steel Katana'] = { item_id = 41, x = 96, y = 288 },
        ['Bronze Arrow'] = { item_id = 42, x = 0, y = 320 },
        ['Iron Arrow'] = { item_id = 43, x = 32, y = 320 },
        ['Steel Arrow'] = { item_id = 44, x = 64, y = 320 },
        ['Bow'] = { item_id = 45, x = 96, y = 320 },
        ['Oak Bow'] = { item_id = 46, x = 0, y = 352 },
        ['Cherry Bow'] = { item_id = 47, x = 32, y = 352 },
        ['Glacial Bow'] = { item_id = 48, x = 64, y = 352 },
        ['Staff'] = { item_id = 49, x = 96, y = 352 },
        ['Copper Ore'] = { item_id = 50, x = 0, y = 384 },
        ['Iron Ore'] = { item_id = 51, x = 32, y = 384 },
        ['Coal'] = { item_id = 52, x = 64, y = 384 },
        ['Gold Ore'] = { item_id = 53, x = 96, y = 384 },
        ['Tin Ore'] = { item_id = 54, x = 0, y = 416 },
        ['Bronze Bar'] = { item_id = 55, x = 32, y = 416 },
        ['Iron Bar'] = { item_id = 56, x = 64, y = 416 },
        ['Steel Bar'] = { item_id = 57, x = 96, y = 416 },
        ['Gold Bar'] = { item_id = 58, x = 0, y = 448 },
        ['Raw Catfish'] = { item_id = 59, x = 32, y = 448 },
        ['Cooked Catfish'] = { item_id = 60, x = 64, y = 448 },
        ['Raw Bubba Bass'] = { item_id = 61, x = 96, y = 448 },
        ['Cooked Bubba Bass'] = { item_id = 62, x = 0, y = 480 },
        ['Bronze Helmet'] = { item_id = 63, x = 32, y = 480 },
        ['Bronze Chestplate'] = { item_id = 64, x = 64, y = 480 },
        ['Bronze Gauntlets'] = { item_id = 65, x = 96, y = 480 },
        ['Bronze Leggings'] = { item_id = 66, x = 0, y = 512 },
        ['Bronze Boots'] = { item_id = 67, x = 32, y = 512 },
        ['Iron Helmet'] = { item_id = 68, x = 64, y = 512 },
        ['Iron Chestplate'] = { item_id = 69, x = 96, y = 512 },
        ['Iron Gauntlets'] = { item_id = 70, x = 0, y = 544 },
        ['Iron Leggings'] = { item_id = 71, x = 32, y = 544 },
        ['Iron Boots'] = { item_id = 72, x = 64, y = 544 },
        ['Steel Helmet'] = { item_id = 73, x = 96, y = 544 },
        ['Steel Chestplate'] = { item_id = 74, x = 0, y = 576 },
        ['Steel Gauntlets'] = { item_id = 75, x = 32, y = 576 },
        ['Steel Leggings'] = { item_id = 76, x = 64, y = 576 },
        ['Steel Boots'] = { item_id = 77, x = 96, y = 576 },
        ['Wizard Robe'] = { item_id = 78, x = 0, y = 608 },
        ['Wizard Skirt'] = { item_id = 79, x = 32, y = 608 },
        ['Shape Robe'] = { item_id = 80, x = 64, y = 608 },
        ['Shape Skirt'] = { item_id = 81, x = 96, y = 608 },
        ['Minion Robe'] = { item_id = 82, x = 0, y = 640 },
        ['Minion Skirt'] = { item_id = 83, x = 32, y = 640 },
        ['Uggs Boots'] = { item_id = 84, x = 64, y = 640 },
        ['Quilted Boots'] = { item_id = 85, x = 96, y = 640 },
        ['Green Boots'] = { item_id = 86, x = 0, y = 672 },
        ['Winged Boots'] = { item_id = 87, x = 32, y = 672 },
        ['Beret'] = { item_id = 88, x = 64, y = 672 },
        ['Bowler Hat'] = { item_id = 89, x = 96, y = 672 },
        ['Ranger Helmet'] = { item_id = 90, x = 0, y = 704 },
        ['Ranger Chestplate'] = { item_id = 91, x = 32, y = 704 },
        ['Ranger Gauntlets'] = { item_id = 92, x = 64, y = 704 },
        ['Ranger Leggings'] = { item_id = 93, x = 96, y = 704 },
        ['Ranger Boots'] = { item_id = 94, x = 0, y = 736 },
        ['Wizard Hat'] = { item_id = 95, x = 32, y = 736 },
        ['Shape Wizard Hat'] = { item_id = 96, x = 64, y = 736 },
        ['Mystic Hat'] = { item_id = 97, x = 96, y = 736 },
        ['Tin of Beer'] = { item_id = 101, x = 0, y = 768 },
        ['Meat'] = { item_id = 102, x = 32, y = 768 },
        ['Cooked Meat'] = { item_id = 103, x = 64, y = 768 },
        ['Energy Weed'] = { item_id = 200, x = 96, y = 768 },
        ['Mortar and Pestle'] = { item_id = 201, x = 0, y = 800 },
        ['Crushed Energy Weed'] = { item_id = 202, x = 32, y = 800 },
        ['Empty Vial'] = { item_id = 203, x = 64, y = 800 },
        ['Filled Vial'] = { item_id = 204, x = 96, y = 800 },
        ['Stamina Potion'] = { item_id = 205, x = 0, y = 832 },
        ['Super Stamina Potion'] = { item_id = 206, x = 32, y = 832 },
        ['Air Shard'] = { item_id = 207, x = 64, y = 832 },
        ['Water Shard'] = { item_id = 208, x = 96, y = 832 },
        ['Earth Shard'] = { item_id = 209, x = 0, y = 864 },
        ['Fire Shard'] = { item_id = 210, x = 32, y = 864 },
        ['Spirit Shard'] = { item_id = 211, x = 64, y = 864 },
        ['Void Shard'] = { item_id = 212, x = 96, y = 864 },
        ['Warp Shard'] = { item_id = 213, x = 0, y = 896 },
        ['Feather'] = { item_id = 300, x = 32, y = 896 },
        ['Flax'] = { item_id = 301, x = 64, y = 896 },
        ['Processed Flax'] = { item_id = 302, x = 96, y = 896 },
        ['Cherry Log'] = { item_id = 303, x = 0, y = 928 },
        ['Glacial Log'] = { item_id = 304, x = 32, y = 928 },
        ['Crafting Knife'] = { item_id = 305, x = 64, y = 928 },
        ['Arrow Shaft'] = { item_id = 306, x = 96, y = 928 },
        ['Bronze Arrowhead'] = { item_id = 307, x = 0, y = 960 },
        ['Iron Arrowhead'] = { item_id = 308, x = 32, y = 960 },
        ['Steel Arrowhead'] = { item_id = 309, x = 64, y = 960 },
        ['Headless Arrow'] = { item_id = 310, x = 96, y = 960 },
        ['Unstrung Bow'] = { item_id = 311, x = 0, y = 992 },
        ['Unstrung Oak Bow'] = { item_id = 312, x = 32, y = 992 },
        ['Unstrung Cherry Bow'] = { item_id = 313, x = 64, y = 992 },
        ['Unstrung Glacial Bow'] = { item_id = 314, x = 96, y = 992 },
        ['Coins'] = { item_id = 999, x = 0, y = 1024 },
    }
}