Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- local fileName = tArgs[1]
- local mon = peripheral.find("monitor")
- local ar = peripheral.find("arController")
- local oldTerm = term.redirect(mon)
- mon.setTextScale(0.5)
- mon.setCursorPos(1,1)
- mon.clear()
- term.setCursorPos(1,1)
- term.clear()
- ar.clear()
- local f, err = fs.open(fileName, "r")
- assert(f, err)
- local texData = textutils.unserialize(f.readAll())
- f.close()
- local W = tArgs[2]--fileData.size.X
- local H = tArgs[3]--fileData.size.y
- local pixelSize = tArgs[4]
- print(W,H)
- for y = 1, H do
- for x = 1, W do
- local col = texData[y * W + x]
- if col == nil then
- break
- end
- --print(string.format("%x", col))
- ar.fill(x * pixelSize, y * pixelSize, (x+1) * pixelSize, (y+1) * pixelSize, col)
- --os.sleep(0.1)
- end
- end
Add Comment
Please, Sign In to add comment