7508 posts
Location
Australia
Posted 23 December 2012 - 03:20 PM
Could it be at all possible that we have getters for background and text colour? we have setters, but almost ALL of the projects I have done so far with colours would have been made SO much easier with getters like this
term.getTextColor()
term.getBackgroundColor()
1548 posts
Location
That dark shadow under your bed...
Posted 24 December 2012 - 12:18 AM
I always just modify the base functions
local sb=term.setBackgroundColor
local curb=colors.black
function term.setBackgroundColor(col)
curb=col
sb(col)
end
function term.getBackgroundColor()
return curb
end
that is the basic idea, of course you would have to execute sb(col) first and check if it is successful first before modifying the curb variable but you get the idea
7508 posts
Location
Australia
Posted 25 December 2012 - 10:30 AM
Yeh that's how I'm doing it at the moment, I just feel its inconvenient to store a 2D table of all the colors on the screen, I feel it could be easier to just have a getter there for us that can either return the color at the current cursor OR the passed in x and y parameters.
724 posts
Posted 26 December 2012 - 03:13 AM
I just cannot find quote where Dan200 deny it. So all you can just ignore this post ;)/> Especial for Cloudy.
8543 posts
Posted 26 December 2012 - 04:16 AM
Get functions for various things have generally been denied. The table of screen lines is probably a good way to do it if you really need them.
6 posts
Posted 28 August 2013 - 08:44 AM
Hello! I am new on the forums :D/>.
When I was looking through the Terminal.class I found this:
public int getTextColour() {
return this.m_textColour;
}
public int getBackgroundColour() {
return this.m_backgroundColour;
}
but I couldn't call those functions, respectively.
8543 posts
Posted 28 August 2013 - 01:11 PM
Of course you can't call Java functions from Lua, unless they are specifically exposed. Not sure why I didn't lock this when I made my previous post. Locked.