Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local gpu = component.gpu -- get primary gpu component
- local w, h
- w_res, h_res = gpu.getResolution()
- w_rel_quotient = w_res/100
- h_rel_quotient = h_res/100
- function w_rel( w) -- w relativ
- return ( w * w_rel_quotient )
- end
- function h_rel( h) -- h relativ
- return ( h * h_rel_quotient )
- end
- gpu.fill(1, 1, w_res, h_res, " ") -- clears the screen
- gpu.setForeground(0xFFFFFF)
- gpu.setBackground(0x000011)
- gpu.fill(w_rel(1), h_rel(1), w_rel(8), h_rel(8), "X") -- fill top left quarter of screen
- print("W:",w_res)
- print("H:",h_res)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement