SHOW:
|
|
- or go back to the newest paste.
| 1 | arg = {...}
| |
| 2 | - | assert(#arg == 2, 'usage: imageDisplay <image name> <advanced monitor side>') |
| 2 | + | assert(#arg == 1, 'usage: imageDisplay <image name>') |
| 3 | ||
| 4 | - | local mon = peripheral.wrap(arg[2]) |
| 4 | + | local mon = screenAPI.wrapMon() |
| 5 | local image = fs.open('mcPaintFolder/images/'..arg[1], 'r')
| |
| 6 | local imageString = image.readAll() | |
| 7 | local imageTable = textutils.unserialise(imageString) | |
| 8 | ||
| 9 | for i = 1, #imageTable do | |
| 10 | for k = 1, #imageTable[i] do | |
| 11 | - | mon.setCursorPos(i,k) |
| 11 | + | screenAPI.drawDot(i, k, imageTable[i][k]) |
| 12 | - | mon.setBackgroundColor(imageTable[i][k]) |
| 12 | + | |
| 13 | - | mon.write(' ')
|
| 13 | + |