I've tried to apply a Pixi filter to a image and save it to cache but the image doesn't get saved with the filter.

colorMatrix = new PIXI.ColorMatrixFilter();
colorMatrix.matrix = [0,0.0,0.5,-0.2, 0,0,1.0,-0.2, 0.0,0.0,0.5,-0.2, 0.0,0.0,0.0,1]
image = game.make.bitmapData()
image.filters = [colorMatrix]
game.cache.addBitmapData("testImageWIthFilter", image);

Is it not possible to save it to cache? The only thing I see is the original image when using the code down below:

messageImage = game.add.sprite(0, 0, game.cache.getBitmapData('testImageWIthFilter'))
  • \$\begingroup\$ How are you using the image? We need to see that part of the code also. \$\endgroup\$ – Katu May 7 '15 at 21:03
  • \$\begingroup\$ @Katu Updated my question! \$\endgroup\$ – Philip May 7 '15 at 21:24
  • \$\begingroup\$ Can't spot anything wrong here.. \$\endgroup\$ – Katu May 7 '15 at 21:31
  • \$\begingroup\$ @Katu But it doesnt work :) \$\endgroup\$ – Philip May 7 '15 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.