215 posts
Location
Netherlands
Posted 18 August 2013 - 06:27 AM
Hello everyone!
I am working on Nebulae API v2.0 and I was adding functionality to display exact numbers. For some reason it doesn't want to color the text. I'll describe what it does:
First it'll retrieve the numbers (this is done in the function called Math)
Then it sends it to the function which will split in different tables where it will put in dots. (Just like in economy where they do that to make it more readable)
It will concatinate it to a string and send it to function splitText where it will split it in different letters so the function can color it.
The code:
http://pastebin.com/21LS9UgTI have no idea where it goes wrong. I hope you guys can help me. Down here are pictures!
[attachment=1312:1.png]
83 posts
Location
Behind you
Posted 18 August 2013 - 06:39 AM
Code snippets would be the best help you can give us.
At the moment I might think you are incorrectly editing the colour, or you are running another program which for some reason, changes the colour back to white.
215 posts
Location
Netherlands
Posted 18 August 2013 - 06:49 AM
Code snippets would be the best help you can give us.
At the moment I might think you are incorrectly editing the colour, or you are running another program which for some reason, changes the colour back to white.
OOPS! Forgot to put the pastebin link in here, sorry!
83 posts
Location
Behind you
Posted 18 August 2013 - 07:11 AM
It looks like it is doing exactly as you've told it to. Do you want the text to be a different colour, or do you want the background a different colour?
You don't change the text colour at all, so I assume you want to change the background colour.
It does change, it prints out a blue bar, then you tell it to change back to black before you write the (text) on lines 56-59
215 posts
Location
Netherlands
Posted 18 August 2013 - 08:26 AM
It looks like it is doing exactly as you've told it to. Do you want the text to be a different colour, or do you want the background a different colour?
You don't change the text colour at all, so I assume you want to change the background colour.
It does change, it prints out a blue bar, then you tell it to change back to black before you write the (text) on lines 56-59
That is for if the length of the bar doesn't reach the text…
3 posts
Posted 18 August 2013 - 05:35 PM
Background color is literally that, the color of the background behind the txt.
I see one mon.setTextColor() and it sets the color to white.
When printing the txt you need to change the color each time to what color you want
E.x.
local mon = peripheral.wrap(sSide)
local string = "Text to change color"
for i=1,#string do
local text = string.sub(string, i, i)
mon.setCursorPos(i, 1)
mon.setTextColor(math.random(2)^math.random(1,16)) --This will grab any color using the binary values
mon.write(text)
end
215 posts
Location
Netherlands
Posted 19 August 2013 - 05:58 AM
Background color is literally that, the color of the background behind the txt.
I see one mon.setTextColor() and it sets the color to white.
When printing the txt you need to change the color each time to what color you want
E.x.
local mon = peripheral.wrap(sSide)
local string = "Text to change color"
for i=1,#string do
local text = string.sub(string, i, i)
mon.setCursorPos(i, 1)
mon.setTextColor(math.random(2)^math.random(1,16)) --This will grab any color using the binary values
mon.write(text)
end
How does this help me? I know how to change the background color…
83 posts
Location
Behind you
Posted 19 August 2013 - 06:15 AM
He was showing you how to edit the TEXT colour.
mon.setTextColor()