function setLineColor(text)
local lccou = string.len(text)
write(text)
local looplc = true
while looplc == true do
write(" ")
lccou = lccou + 1
if lccou == 51 then
looplc = nil
lccou = nil
end
end
print("")
end
Change Colour of full Line
Started by Wilma456, Nov 13 2016 02:54 PM
5 replies to this topic
#1
Posted 13 November 2016 - 02:54 PM
How can I change the Colour of a full Line? I had ever used this code, but its very slow.
#2
Posted 13 November 2016 - 03:18 PM
What do you want to achieve?
A empty line with a specific color?
A empty line with a specific color?
function setLineColor(y, col) term.setCursorPos(1, y) term.setBackgroundColor(col) term.clearLine() endOr an empty line form x1 to x2?
function setLineColor(x1, x2, y, col) paintutils.drawFilledBox(x1, y, x2, y, col) endOr what do you mean?
#4
Posted 13 November 2016 - 04:58 PM
Just attach some spaces to the end of the text so that it writes to the edge of the screen. Something like this:
function writelineInColor( text, color ) term.setBackgroundColor( color ) term.write( text .. string.rep( ' ', term.getSize() - #text ) ) end
#5
Posted 13 November 2016 - 05:52 PM
KingofGamesYami, on 13 November 2016 - 04:58 PM, said:
Just attach some spaces to the end of the text so that it writes to the edge of the screen. Something like this:
function writelineInColor( text, color ) term.setBackgroundColor( color ) term.write( text .. string.rep( ' ', term.getSize() - #text ) ) end
I had tested this in Mynaptic: This code only overitete line 2. Any other line is not suportet.
#6
Posted 13 November 2016 - 06:09 PM
You have to set the cursor position before
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











