Closed zachdsawyer closed 9 years ago
Oh, I know the pixi.js engine's Sprite and MovieClip does not support dynamic change color.If I am wrong please tell me.Thank you very much!
If anyone cares, Pixi has a tint function.
so particleSprite.tint = particle.color should work.
If you are using two colors in the emitter.addBehaviour -
emitter.addBehaviour new Proton.Color("#C97024", "#290000")
You will have to update the tint to the transform color. -
particleSprite.tint = '0x' + colorchange.rgbToHex( particle.transform.rgb.r, particle.transform.rgb.g, particle.transform.rgb.b)
I wrote my own rgbToHex (colorchange.rgbToHex) function, but I think PIXI has a PIXI.rgb2hex function that will probably work.
shawnsnyder thanks you very much :)
I'm using Pixi.js, but I can't get the random color behaviour to work.
http://www.a-jie.cn/proton/example/render/custom/pixijs.html Add this, and it doesn't change the color.
emitter.addBehaviour(new Proton.Color('random'));
I looked at Color.prototype.applyBehaviour, it is executing, but it's not showing up in the render.
I love the framework otherwise, great work!