What is the best way to get the size of a terminal, then print out a gui that fits that? Up until this point, I've done non-stretching GUIs, which I know people don't neccessarily like. *cough* Engineer *cough* Also, I know how to print a picture, but can I stretch that, or is there some other way to draw a background?
Thanks,
~Csstform
GUI Help
Started by Csstform, Apr 02 2014 12:03 PM
4 replies to this topic
#1
Posted 02 April 2014 - 12:03 PM
#2
Posted 02 April 2014 - 12:16 PM
What kind of gui do you mean? Can you make some paint-like example of what you mean?
And the best way to get the terminal size is ofcourse
And the best way to get the terminal size is ofcourse
local w, h = term.getSize()A function that I use when drawing gui etc
local function drawBox( sX, fX, sY, fY, background ) if term.isColor() then if background then term.setBackgroundColor( background ) end end local line = "" for x = sX, fX do line = line .. " " end for y = sY, fY do term.setCursorPos( sX, y ) term.write( line ) end endAs you probably have figured out it draws boxes, But it can be very useful when creating GUI
Edited by Hellkid98, 02 April 2014 - 12:17 PM.
#3
Posted 02 April 2014 - 12:27 PM
Hellkid98, on 02 April 2014 - 12:16 PM, said:
What kind of gui do you mean? Can you make some paint-like example of what you mean?
And the best way to get the terminal size is ofcourse
And the best way to get the terminal size is ofcourse
local w, h = term.getSize()A function that I use when drawing gui etc
local function drawBox( sX, fX, sY, fY, background ) if term.isColor() then if background then term.setBackgroundColor( background ) end end local line = "" for x = sX, fX do line = line .. " " end for y = sY, fY do term.setCursorPos( sX, y ) term.write( line ) end endAs you probably have figured out it draws boxes, But it can be very useful when creating GUI
Link to a mock up of what I want: https://github.com/G...ster/tdlbak.nfp
#4
Posted 02 April 2014 - 01:03 PM
Csstform, on 02 April 2014 - 12:27 PM, said:
Hellkid98, on 02 April 2014 - 12:16 PM, said:
What kind of gui do you mean? Can you make some paint-like example of what you mean?
And the best way to get the terminal size is ofcourse
And the best way to get the terminal size is ofcourse
local w, h = term.getSize()A function that I use when drawing gui etc
local function drawBox( sX, fX, sY, fY, background ) if term.isColor() then if background then term.setBackgroundColor( background ) end end local line = "" for x = sX, fX do line = line .. " " end for y = sY, fY do term.setCursorPos( sX, y ) term.write( line ) end endAs you probably have figured out it draws boxes, But it can be very useful when creating GUI
Link to a mock up of what I want: https://github.com/G...ster/tdlbak.nfp
#5
Posted 02 April 2014 - 01:11 PM
Thanks for the help, I think the folks on IRC have helped me figure this out.
3 user(s) are reading this topic
0 members, 3 guests, 0 anonymous users











