shapes

ok so im watching a tutorial and maybe they are using an older version of lua or corona, which makes this more confusing for a newb. when i try to make a green rectangle in side of the red rectangle my red rectangle turns green and  the other turns white.

local line = display.newLine(100,100, 200,0); line:setColor(255,255,255); line.strokeWidth = 3; line:append(300,100, 100,100); local square = display.newRect(200,200, 200,200); square.strokeWidth = 1; square:setFillColor(255,0,0); square:setStrokeColor(255,255,255); local rect = display.newRect(200,150, 50,70); square.strokeWidth = 8; square:setFillColor(0,255,0); square:setStrokeColor(255,255,255);

if i delete local rect the square turns red again. Heres the jpg

Edit: i’ve tried overlaying shapes over the red square and it wont fill color, whats the jam?

You’re still assigning to “square”, not “rect”, in your last three lines.

Also, it is using an older version, yes… all those 255 values should now be 1 instead (colors got scaled from 0-255 to 0-1).

You’re still assigning to “square”, not “rect”, in your last three lines.

Also, it is using an older version, yes… all those 255 values should now be 1 instead (colors got scaled from 0-255 to 0-1).