Search code examples
javascriptjquerycanvascreatejs

createJS issue with AlphaMaskFilter


I am having an issue with AlphaMaskFilter using createJS. I am using the example code from previous discussions on the forum and including both alphamaskfilter.js from github and easelJS from the CDN and am still getting undefined is not a function. Can someone offer a different look at this issue? I am choosing not to include preloader because of the high volume on the site.

lenses = new Image(); lenses.onload = function() {

var image = new createjs.Bitmap('images/reflection.png');
var maskImage = new createjs.Bitmap('images/1-1.png');

var amf = new createjs.AlphaMaskFilter(maskImage.image);
image.filters = [amf];
image.cache(0, 0, maskImage.image.width, maskImage.image.height);

    glasses_container.addChild(image);

    stage.update();
}
lenses.src = 'images/reflection.png'

Previous Discussion Examples http://jsfiddle.net/Bpz88/193/ http://community.createjs.com/discussions/easeljs/584-alphamapfilter-using-alpha-png-image-to-mask-jpg


Solution

  • Filters currently are not included in the EaselJS package, so you have to include the filters on the page yourself, do you do that?