summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-04-01 04:36:56 +0100
committerubq323 <ubq323@ubq323.website>2024-04-01 04:36:56 +0100
commit4aa33c21da808c79046b5fb85c6873d88bd589c9 (patch)
treeb8bcb1c197a4113d2e5cca7e2d3ef1cb0889e3b7
parente94740c9a4cf94a100a1e6bf6ecce361cb10a668 (diff)
launch john
-rw-r--r--john.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/john.lua b/john.lua
index fa6bd08..82f309c 100644
--- a/john.lua
+++ b/john.lua
@@ -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)