Plantilla:Sprite

De WikiMinecraft
Revisión del 23:32 13 ago 2014 de Xstela (discusión | contribuciones)
(dif) ← Revisión anterior | Revisión actual (dif) | Revisión siguiente → (dif)
Saltar a: navegación, buscar
[purge]

Esta es la página de documentación, debería ser transcluida a la página de plantilla principal. Véase Plantilla:Documentation para más información.

Lua logo.png
Esta plantilla usa Módulo:Sprite, un script escrito en el lenguaje de programación Lua. Por favor lea mw:Lua y mw:Extension:Scribunto para saber más del lenguaje Lua.

Esta plantilla crea un sprite de la imagen de una hoja. De uso general cuando son mostradas muchas imágenes pequeñas en una página para reducir la cantidad total de conexiones HTTP.

Ejemplos

{{Sprite
|pos=1
|align=text-top
|image=BlockCSS.png
|link=Grass Block
|text=Grass
|size=16
|sheetsize=256
}}
nos da:
BlockCSS.png
Parámetro Función Valor por defecto
align Sets the vertical alignment of the image to the text. middle
class Add additional classes to .sprite None
css Add styling to .sprite None
defaultpos The default position used if no position is set. 1
image Sprite sheet image, without prefix None
link Create a link to this page None
name Sets the name for this spritesheet, used to:
  1. get the position definitions: Module:Sprite/<name>
  2. part of the classname if it's in the imgClasses table: <name:lower>-sprite
  3. part of the image name, if image isn't set: <name>Sprite.png
None
pos Position index of the sprite, depends on size and sheetsize (left to right, starting at top-left sprite) defaultpos
scale Scale the sprite larger or smaller 1
sheetsize Width of the whole sheet in pixels. Must be multiple of size 256
size Size of each sprite in pixels, width and height 16
text Show some text after the sprite, if link is set, this text will also be linked. None
title Set a title to be displayed when hovering over the sprite or text, overrides the link's title. None

Véase también