i’m a little stuck on trying to fill the shape color of one of the shapes i created TT no matter what i do, it either doesn’t show when i press play or i get that red highlight
– Line thickness, background, general
strokeWidth(200)
fill(233, 142, 80)
background(122, 134, 210)
– The shapes
rect(200, 400, 200, 100)
ellipse(300, 250, 200)
i don’t know where to insert fill. sorry if this is a rookie question, i’m very new to coding as a whole and i couldn’t find answers that would work for Codea that didn’t sound complicated
please show the whole (small) program. I’ll provide a tiny example below, unless someone beats me to it.
Here’s a sample. Things draw go in the draw function, or are called by the draw function, which is called repeatedly as the program runs.
-- stuff
-- Use this function to perform your initial setup
function setup()
print("Hello World!")
end
-- This function gets called once every frame
function draw()
-- This sets a dark background color
background(40, 40, 50)
-- Line thickness, background, general
strokeWidth(200)
fill(233, 142, 80)
background(122, 134, 210)
-- The shapes
rect(200, 400, 200, 100)
ellipse(300, 250, 200)
end
Here’s an updated example of the above code.
-- stuff
viewer.mode=FULLSCREEN
-- Use this function to perform your initial setup
function setup()
print("Hello World!")
end
-- This function gets called once every frame
function draw()
-- This sets a dark background color
background(40, 40, 50)
-- sets the outline thickness and color
stroke(255,0,0)
strokeWidth(10)
-- sets the inside color
fill(233, 142, 80)
-- The shapes
rect(200, 400, 200, 100)
ellipse(300, 250, 200)
end
a noticeable improvement. I did like that I was able to use OP’s code directly, however, as the first step.
@RonJeffries When I ran your code, all I got was a white rect and ellipse. The strokeWidth(200) was messing things up. The double background() wasn’t doing anything either.
yes. my point was only to show where the draw code goes. you improved the situation.