115 posts
Location
Maidstone, UK
Posted 03 October 2014 - 06:46 PM
Hey there,
I was wondering if there was a way to get the specific color of a pixel on the screen?
If there is, how would I go about using it?
Thanks,
- Sam
227 posts
Location
Germany
Posted 03 October 2014 - 06:50 PM
Unless you write a utility that saves the background/text color in some way, each time you call term.write(), there is no way to do that, no.
115 posts
Location
Maidstone, UK
Posted 03 October 2014 - 06:57 PM
Unless you write a utility that saves the background/text color in some way, each time you call term.write(), there is no way to do that, no.
I am drawing pixels using paintutils.drawPixel()
Does this change anything?
Thanks,
- Sam
44 posts
Posted 03 October 2014 - 07:03 PM
function drawPixel( xPos, yPos, nColour )
if type( xPos ) ~= "number" or type( yPos ) ~= "number" or type( nColour ) ~= "number" then
error( "Expected x, y, colour", 2 )
end
term.setBackgroundColor( nColour )
drawPixelInternal( xPos, yPos )
end
local function drawPixelInternal( xPos, yPos )
term.setCursorPos(xPos, yPos)
term.write(" ")
end
As you see you cant, but you can create table that will have everything saved. and print stuff from that table
115 posts
Location
Maidstone, UK
Posted 03 October 2014 - 08:18 PM
Okay, thanks. I'm going to store the whole thing in a table, and when it is needed to be saved, save all of the stuff in the table and there! Saved!
Many thanks,
- Sam