Any1 have a handy tutorial anywhere on making specific blocks different colors?
I can seem to find tutorials on this kinda thing?
Thanks
[Question] Help with pixels
Started by Stormkrow, Nov 14 2012 12:31 AM
4 replies to this topic
#1
Posted 14 November 2012 - 12:31 AM
#3
Posted 14 November 2012 - 02:58 AM
Yeah as in make a pixel say 1, 2 be green and pixel 1, 3 be blue?
#4
Posted 14 November 2012 - 03:24 AM
In order to color a "pixel" (cursor position) you have to set the background color and then write a space.
Edit: Changed the ending of the code slightly.
local function setPixel(x, y, color)
if not term.isColor() then
error("This is not an advanced terminal.")
end
term.setBackgroundColor(color)
local oldX, oldY = term.getCursorPos()
term.setCursorPos(x, y)
write(" ")
term.setCursorPos(oldX, oldY)
end
term.clear()
setPixel(1, 2, colors.lime)
setPixel(1, 3, colors.blue)
-- This is just to get the cursor out of the way so you can see the results.
local _, y = term.getSize()
term.setCursorPos(1, y)
Edit: Changed the ending of the code slightly.
Edited by Espen, 14 November 2012 - 03:27 AM.
#5
Posted 14 November 2012 - 03:34 AM
Well, i found what i was looking for!!! it was the paintutils api!!! Thanks alot though!! The paintutils.drawPixel(x,y,color) was what i mean very helpful, saw it in some code in another program! I further went into a computer and typed 'Help paintutils' and it popped up!! Thanks for effort though guys ^^
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












