I am trying to create a rope image using a filled path. The method I would prefer to use is a stroked line, with the stroke fill by a repeated image. The code I have below causes a filled stroke, but it appears to be a one pixel-wide column of pixels from the fill image, repeated throughout the stroke (though it does follow the path properly.)
local halfW, halfH = display.contentCenterX, display.contentCenterY local circle = display.newCircle( halfW, halfH+260, 200 ) -- Fill with image local imagePaint = { type="image", filename="crate.png" } circle.fill = imagePaint -- Anti-alias stroke local brush = { type="image", filename="wood.png"} circle.stroke = brush --circle:setStrokeColor( 0, 1, 1 ) -- tint brush image circle.strokeWidth = 60 local line = display.newLine( 100, 100, 200, 120 ) line:append( 300, 160, 400, 220, 500, 320 ) line.width = 50 line.stroke = brush local img = display.newImage("wood.png") img.x, img.y = 300, 400 img.xScale, img.yScale = 10, 10
What I was hoping for was to create a line with a thick stroke and many points (to give the impression of a smooth curve) and to have the filling image repeat smoothly along the path. The problem is that - unlike with body fills - the stroke fill seems to only use 1 column of pixels from the brush image.