phaser icon indicating copy to clipboard operation
phaser copied to clipboard

Blendmode not working on images inside a container

Open TadejZupancic opened this issue 8 years ago • 2 comments

I don't know if this is a bug or is not yet implemented, but adding two images to a container displays them as if default blendmode was set.

var image = this.add.image(100, 100, 'disk'); var image2 = this.add.image(150, 150, 'disk'); image2.blendMode = 2; var container = this.add.container(0, 0, [ image, image2 ]); // works fine without this line

TadejZupancic avatar May 21 '18 13:05 TadejZupancic

Yes, it's not implemented yet. As we can't multiply blend modes I'm guessing that whatever is set as the blend mode at the very top of the container chain overrides everything else below it.

photonstorm avatar May 22 '18 15:05 photonstorm

Thank you for submitting this feature request. We have implemented this and the feature has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

To clarify: If a Container has a blend mode set, all children will use it. If it doesn't, and a child has a blend mode set, that will be used. Parent overrides child.

photonstorm avatar Aug 21 '18 21:08 photonstorm