This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
jonny190's profile picture

Help resizing program to use monitor?

Started by jonny190, 29 December 2014 - 11:27 PM
jonny190 #1
Posted 30 December 2014 - 12:27 AM
Not sure if i need a new thread but i have http://pastebin.com/GTssSbsi that gives me the ability to view quantities of items etc just wonering if anyone can help me resize it to a 4x4 monitor?
Lyqyd #2
Posted 30 December 2014 - 12:52 AM
Split to new topic.
metron80 #3
Posted 03 January 2015 - 04:53 PM
You need to be continuously checking if the terminal resizes using os.PullEvent(). Example:

while true do
  os.pullEvent("term_resize")
  local w, h = term.getSize()
  print('Term Size: '..w..', '..h)
  --you should redraw your user interface here to ensure it fills the entire screen and is not clipped
end
If it resizes, you have to adjust you GUI to fit the new screen.