How to use new composite effect with images from image sheet?

Hi,

I’m trying to use the new G2.0 feature to anhance an image with a composite effect. however, all the sample code in the tutorial relate to simple image taken directly from the file system.

In a real project, the image is usually taken from an image sheet and probably has mask on it as well (as mine does). how can I perform an effect on such an object?

for example I have this code:

Assume params: sheet1, options[], frames[], maskName

local sheet = graphics.newImageSheet( sheet1, options ) local g = display.newGroup() local im = display.newImageRect(sheet, 1, frames[1].width, frames[1].height) g:insert(im) local mask = graphics.newMask(maskName.."Mask.png") im:setMask(mask)    local overIm= display.newImageRect(sheet, 2, frames[2].width, frames[2].height)

now I want to add something like this:

local compositePaint = { type="composite", paint1={ type="image", filename=im }, paint2={ type="image", filename=overIm } } local r = display.newRect(0,0,300,300) -- Apply the composite paint as the object's fill r.fill = compositePaint -- Set a composite blend as the fill effect r.fill.effect = "composite.add"

Bitmap paint seems to be capable to load only full image directly from file system, not use any preloaded object.

There seem to be a way to use image from image sheets directly:

paint1={ type=“image”, sheet=sheet1, frame=1 }

However, I couldn’t find a method to use an existing object as input. it probably must be a bitmap.

I am trying to add depth to an image with mask. Using bump/normal map would have solved it, but I can’t figure out if this is even possible in 2.0

There seem to be a way to use image from image sheets directly:

paint1={ type=“image”, sheet=sheet1, frame=1 }

However, I couldn’t find a method to use an existing object as input. it probably must be a bitmap.

I am trying to add depth to an image with mask. Using bump/normal map would have solved it, but I can’t figure out if this is even possible in 2.0