Open melanke opened 11 years ago
maybe this can help http://www.html5canvastutorials.com/advanced/html5-canvas-global-composite-operations-tutorial/
each layer, before drawing itself, loads the mask of its element, make the path of the mask, and then:
CC.context.globalCompositeOperation = "source-in";
//a mask may have all params that define a shape
var mask = {
shape: "rect",
w: 300,
h: 200,
fixed: true //and an extra param to make it fixed to screen
};
CC.merge(CC("#Element").e(0).layers["first"], {
mask: mask
});
CC.context.globalCompositeOperation is already being use in blendMode, so... I don't know if it will be possible to use it twice
CC("InsideInnerFrame").mask([ [30,30], [430,30], [430,130], [30,130] ]);
Might be a difficult task