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

[Question] Frame.

Started by Mackan90096, 03 June 2013 - 03:46 AM
Mackan90096 #1
Posted 03 June 2013 - 05:46 AM
Hi! I'm bored so I'm derping around with stuff.

But I'm wondering if you can make a frame around the term for multiple sizes.

If so, how?

Thanks // Mackan90096
GravityScore #2
Posted 03 June 2013 - 06:43 AM
Not sure which part of the term you are talking about - you mean using Lua, or modifying CC directly, to change the yellow/gray border around the term?

In Lua, that's simple:

width = 2
term.setBackgroundColor(colors.red)
w, h = term.getSize()
for x = 1, width do term.setCursorPos(1, x) term.clearLine() end
for x = h - width + 1, h do term.setCursorPos(1, x) term.clearLine() end
for i = 1, width do
  for x = 1, h do term.setCursorPos(i, x) term.write(" ") end
  for x = 1, h do term.setCursorPos(w - i + 1, x) term.write(" ") end
end

If you mean the actual gray/yellow border, you can unzip CC in the mods folder, and go to mods/ComputerCraft/textures, and in each of those folders in there are the image files for the computer, the borders, etc… Under GUI is the borders around the term.
Mackan90096 #3
Posted 03 June 2013 - 06:44 AM
Not sure which part of the term you are talking about - you mean using Lua, or modifying CC directly, to change the yellow/gray border around the term?

In Lua, that's simple:

width = 2
term.setBackgroundColor(colors.red)
w, h = term.getSize()
for x = 1, width do term.setCursorPos(1, x) term.clearLine() end
for x = h - width + 1, h do term.setCursorPos(1, x) term.clearLine() end
for i = 1, width do
  for x = 1, h do term.setCursorPos(i, x) term.write(" ") end
  for x = 1, h do term.setCursorPos(w - i + 1, x) term.write(" ") end
end

If you mean the actual gray/yellow border, you can unzip CC in the mods folder, and go to mods/ComputerCraft/textures, and in each of those folders in there are the image files for the computer, the borders, etc… Under GUI is the borders around the term.

Thanks.

I mean in LUA too