I have a simple program here which I am expecting to see just black screen. It turns out to have a white border around it. This means that rect doesn’t fill up the entire screen. Why? What am I missing? I am running Codea 2.7.3 on iPad mini with iOS 12.1.1
function setup()
end
function draw()
background(255, 255, 255, 255)
-- why this leaves white border around the screen?
-- strokeWidth(3) -- any number here doesn't make any differences
stroke(0, 0, 0, 255)
fill(0, 0, 0, 255)
rectMode(CORNER)
rect(0, 0, WIDTH, HEIGHT)
-- add this doesn't help either
-- strokeWidth(1) -- only when this is >= 2
line(0, 0, 0, HEIGHT)
line(0, HEIGHT, WIDTH, HEIGHT)
line(WIDTH, HEIGHT, WIDTH, 0)
line(0, 0, WIDTH, 0)
end
function setup()
end
function draw()
background(255, 255, 255, 255)
fill(0, 0, 0, 255)
noSmooth() -- add this
rectMode(CORNER)
rect(0, 0, WIDTH, HEIGHT)
end
@dave1707 - wasn’t sure which one ite was, used both of them once in a texture which left a gap without them. Never chased up to see which one removed the gap. Thanks.
@tsukit smooth and noSmooth aren’t for curves. Their purpose is to average the color from one area to another or not. If you have a white area overlapping a black area, then smooth will average the area along the border of those 2 areas. noSmooth won’t and the border area will just go from one color to the other.