diff options
-rw-r--r-- | john.lua | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -15,8 +15,15 @@ if monitors == nil or #monitors < 1 then end fb:ppm(fs.open("img/john.pnm","rb")) -print("size!!",fb:get_size()) -local xoffs = 0 +local W,H = fb:get_size() + +local total_width = 0 +for ix,iname in ipairs(monitors) do + local mon = peripheral.wrap(iname) + total_width = total_width + (mon.getSize()) +end +local leftover = total_width - W +local xoffs = math.floor(leftover/2) for ix,iname in ipairs(monitors) do print("doing",ix,iname) |