I tried to use containers. As a result, the stroke of shapes became black:
How I can fix it? My code:
[lua]local function getShape( shape )
if( shape == ‘circle’ ) then
shape = display.newCircle( 0, 0, 50 )
elseif( shape == ‘rect’ ) then
shape = display.newRect( -50, -50, 100, 100 )
end
shape.strokeWidth = 15
shape:setStrokeColor( 255, 0, 0 )
shape:setFillColor( 255, 255, 0 )
return shape
end
local circle1, circle2 = getShape( ‘circle’ ), getShape( ‘circle’ )
circle1:translate( 100, 100 )
circle2:translate( 100, 250 )
local rect1, rect2 = getShape( ‘rect’ ), getShape( ‘rect’ )
rect1:translate( 250, 100 )
rect2:translate( 250, 250 )
local group = display.newGroup( )
local container = display.newContainer( 350, 350 )
display.newText( ‘Group:’, 30, 20 ):setTextColor( 0 )
display.newText( ‘Container:’, 30, 170 ):setTextColor( 0 )
group:insert( circle1 )
group:insert( rect1 )
container:insert( circle2 )
container:insert( rect2 )[/lua]