Module:Sprite: Difference between revisions

Jump to navigation Jump to search
11 bytes added ,  31 May 2022
no edit summary
No edit summary
No edit summary
 
Line 37: Line 37:
)
)
:tag('span')
:tag('span')
:css({
:cssText(
position = 'absolute',
string.format(
height = tostring(sheetHeight * ratio) .. 'px',
[[
width = tostring(sheetWidth * ratio) .. 'px',
position: absolute;
top = tostring((offsetY - cellHeight * row) * ratio) .. 'px',
height: %dpx;
left = tostring((offsetX - cellWidth * col) * ratio) .. 'px'
width: %dpx;
})
top: %dpx;
left: %dpx;
]],
sheetHeight * ratio,
sheetWidth * ratio,
(offsetY - cellHeight * row) * ratio,
(offsetX - cellWidth * col) * ratio
)
)
:wikitext(string.format('[[%s|%dpx|class=pixelart]]', image, sheetWidth * ratio))
:wikitext(string.format('[[%s|%dpx|class=pixelart]]', image, sheetWidth * ratio))
:done()
:done()

Navigation menu