Topic on Project:Support desk

71.218.98.92 (talkcontribs)

I'm trying to accomplish something similar to the Minecraft wiki, where they use 1 large image with thousands of tiny sprites, only rendering a small section of the image, instead of uploading thousands of images. However, I see that the SpriteSheet extension Extension:SpriteSheet is no longer updated and doesn't work on the newest version. It appears the Minecraft wiki uses a whole bunch of templates, modules, and widgets, and I tried copying them to my wiki, however this didn't seem to work. Are there any other alternatives to accomplish this?


Thanks!

Ciencia Al Poder (talkcontribs)

You can do this with CSS, using the image as a background-image, with a different background-position for each item, and setting a defined width and height to the element that will display the image.

See https://css-tricks.com/css-sprites/

For setting a background-image I'd recommend using Extension:TemplateStyles, although you can define it in MediaWiki:Common.css as well. The other CSS properties can be set inline. You can use a template for this, with a big switch, or even better if you use a Lua module (you can define all the data in json).

By clicking "Reply", you agree to our Terms of Use and agree to irrevocably release your text under the CC BY-SA 3.0 License and GFDL.