Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("GraphicsAPI")
- mon = peripheral.wrap("left")
- term.redirect(mon)
- GraphicsAPI.resetSurface()
- GraphicsAPI.resetScreen()
- screenWidth, screenHeight = term.getSize()
- print("X:" ..x .." Y:" .. y)
- tileX = math.floor(screenWidth / 8)
- tileY = math.floor(screenHeight / 5)
- print("tileX:" ..tileX .." tileY:" ..tileY)
- topMenu = {
- {name = "back", text = "", x = 1, y = 1, width = tileX, height = tileY, color = colors.red},
- {name = "title", text = "", x = tileX + 1, y = 1, width = tileX * 6, height = tileY, color = colors.blue},
- {name = "next", text = "", x = tileX * 7 + 1, y = 1, width = tileX, height = tileY, color = colors.red},
- {name = "a", text = "A", x = 1, y = tileY + 1, width = tileX, height = tileY, color = colors.green},
- {name = "b", text = "B", x = tileX * 2 + 1, y = tileY + 1, width = tileX, height = tileY, color = colors.cyan},
- {name = "c", text = "C", x = tileX * 3 + 1, y = tileY + 1, width = tileX, height = tileY, color = colors.green},
- {name = "d", text = "D", x = tileX * 4 + 1, y = tileY + 1, width = tileX, height = tileY, color = colors.cyan},
- -- {name = "e", text = "E", x = tileX * 5 + 1, y = tileY + 1, width = tileX, height = tileY, color = colors.green},
- -- {name = "f", text = "F", x = tileX * 6 + 1, y = tileY + 1, width = tileX, height = tileY, color = colors.cyan},
- -- {name = "g", text = "G", x = tileX * 7 + 1, y = tileY + 1, width = tileX, height = tileY, color = colors.green},
- -- {name = "h", text = "H", x = tileX * 8 + 1, y = tileY + 1, width = tileX, height = tileY, color = colors.cyan}
- }
- for i=1, #topMenu do
- GraphicsAPI.drawRect({topMenu[i]["x"], topMenu[i]["y"]}, {topMenu[i]["x"] + topMenu[i]["width"], topMenu[i]["y"] + topMenu[i]["height"]}, topMenu[i]["color"], topMenu[i]["color"])
- end
- --GraphicsAPI.drawRect({1, 1}, {9, 6}, colors.red, colors.red)
- --GraphicsAPI.drawRect({10, 1}, {73, 6}, colors.blue, colors.blue)
- --GraphicsAPI.drawRect({74, 1}, {82, 6}, colors.red, colors.red)
- term.restore();
- GraphicsAPI.update()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement