Ningow

Preview.lua

Nov 3rd, 2020
47
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function init()
  2.     setName("Tiled Preview")
  3.     setDesc("Preview in a tiled grid")
  4.     setSize(80+32, 24+128+8+8+7+4)
  5.     addOutput(24+32)
  6.     addInput("Texture", 88+8*2)
  7.     addParameter("Amount","Tile Amount",88+8*4,2,1,4)
  8. end
  9. function apply()
  10.     tileSize = getTileSize()
  11.     tileSize = 64
  12.     count = getValue(1,0,0,1)
  13.     for i=0, tileSize*tileSize-1 do
  14.         x = i%tileSize
  15.         y = math.floor(i/tileSize)
  16.         cr, cg, cb = getValue(0, x*count, y*count, 1.0)
  17.         setPixel(0, x, y, cr, cg, cb)
  18.     end
  19. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×