0
\$\begingroup\$

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.load("testImage")
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'))
\$\endgroup\$
4
  • \$\begingroup\$ How are you using the image? We need to see that part of the code also. \$\endgroup\$ Commented May 7, 2015 at 21:03
  • \$\begingroup\$ @Katu Updated my question! \$\endgroup\$ Commented May 7, 2015 at 21:24
  • \$\begingroup\$ Can't spot anything wrong here.. \$\endgroup\$ Commented May 7, 2015 at 21:31
  • \$\begingroup\$ @Katu But it doesnt work :) \$\endgroup\$ Commented May 7, 2015 at 21:33

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.