I have searched the whole documents in fact i downloaded them and searched manually. All i found was filter method which allows one to use webgl shadders which you have to write.
What i want is sort of blending as you would see in photoshop light blend for layers etc.
On internet i find examples in pixijs and talk about supporting it in future that happened half year ago. So please anyone who has been following phaserjs and know about filter/blendMode please let me know.
2
Answers
New Phaser 2.0 introduces
blendMode
property for Sprite object. And there is a PIXI enumration for identifying one:So, you can simply write
And here it is.
you can simply use :
where:
spriteName is the name of the sprite( let’s say player / enemy) and
TypeOfBlendMode is the type of blend you want to use (which can be one of the following:
NORMAL, ADD, MULTIPLY, SCREEN, OVERLAY, DARKEN, LIGHTEN, COLOR_DODGE, COLOR_BURN, HARD_LIGHT, SOFT_LIGHT, DIFFERENCE, EXCLUSION, HUE, SATURATION, COLOR, LUMINOSITY ).
Example: let’s say the sprite name is player and i want to set the blend mode to MULTIPLY then i will write: