You could try putting the capture into a canvas.
If your parts will be rectangular, you could just make a sprite sheet, create each “frame”, and go from there.
Otherwise, say with a polygon, you’re bound to get a little weirdness since the image will center and resize according to the polygon’s bounding box.
If you didn’t need the vertex userdata for something else, you might do a shader like so:
local kernel = { category = "filter", group = "shard", name = "basic_uv" }
kernel.vertexData = {
{
name = "min_u",
default = 0,
min = 0,
max = 1,
index = 0
},
{
name = "min_v",
default = 0,
min = 0,
max = 1,
index = 1
},
{
name = "max_u",
default = 1,
min = 0,
max = 1,
index = 2
},
{
name = "max_v",
default = 1,
min = 0,
max = 1,
index = 3
},
}
kernel.vertex = [[
P_POSITION vec2 VertexKernel (P_POSITION vec2 position)
{
v_TexCoord = mix(CoronaVertexUserData.xy, CoronaVertexUserData.zw, CoronaTexCoord);
return position;
}
]]
graphics.defineEffect(kernel)
local r1 = display.newImageRect("Front3.png", 250, 250) -- use canvas.filename, canvas.baseDir
local r2 = display.newImageRect("Front3.png", 250, 250) -- ditto
r1.x, r1.y = 200, 200
r2.x, r2.y = 200, 700
r1.fill.effect = "filter.shard.basic_uv"
r2.fill.effect = "filter.shard.basic_uv"
r1.fill.effect.min_u = .6 -- start 60% to the right in the image
r2.fill.effect.min_v = .3 -- start 30% of the way down...
r2.fill.effect.max_v = .8 -- ...and finish 80%
With rect distortion, you could probably get the polygonal behavior you need. There are other possible approaches too, but they get a little weird. ![:slight_smile: :slight_smile:](https://forums.solar2d.com/images/emoji/apple/slight_smile.png?v=10)