the use of fill seems to apply to the background as well (inside a draw function) whereas the inlcuded notes implies that it applies to rect() and ellipse(). How do I specifically apply fill() to a rectangle?
function setup() parameter("Temperature",-50,50) parameter("RelativeHumidity",0,100) displayMode(STANDARD) end
function draw() background(57, 66, 205, 255) displayTemp=string.format("%4.1f",Temperature) displayRH = string.format("%3d",RelativeHumidity) fontSize(96) stroke(215, 53, 53, 255) strokeWidth(2)
rect(WIDTH/2,HEIGHT - 50,50,100)
text(displayTemp,WIDTH/2,HEIGHT - 50)
text(displayRH,WIDTH/2,HEIGHT - 200)
end
You can format the code using ~ three times before and after the code.
function setup()
parameter("Temperature",-50,50)
parameter("RelativeHumidity",0,100)
displayMode(STANDARD)
end
function draw()
background(57, 66, 205, 255)
displayTemp=string.format("%4.1f",Temperature)
displayRH = string.format("%3d",RelativeHumidity)
strokeWidth(2)
--fill background for rect
fill(44, 241, 45, 255)
--set border color
stroke(0, 255, 0, 255)
rect(WIDTH/2,HEIGHT - 50,50,100)
fontSize(96)
fill(255)
-- set color for text
text(displayTemp,WIDTH/2,HEIGHT - 50)
text(displayRH,WIDTH/2,HEIGHT - 200)
end
Thanks this is what I needed to know. You have helped perfectly despite your claim as to not understanding my question.
It looks like you're new here. If you want to get involved, click one of these buttons!