DragonBones / DragonBonesJS

DragonBones TypeScript / JavaScript Runtime
MIT License
764 stars 318 forks source link

FEATURE: masking in PIXI (blendmode alpha) #44

Open bitbay opened 7 years ago

bitbay commented 7 years ago

Hello, with the recent release of pixi 4.6.0 (including a relevant bugfix of "textures from atlas as mask") the masking of slots/armatures should be possible. I am trying to achieve something similar to this gist - please have a look at the _updateBlendMode method.

For now (and for the lack of a better idea) if i find a sprite with blending set to alpha, i add it as it's parents mask (should use z-order instead?), and i don't handle removing the display (i'm confused where it's necessary to check this) at all.

Pixijs supports PIXI.Sprite, PIXI.Graphics (stencil) and scissor masking.

I think a correct implementation could include:

Do You have any plans to add support for this?

akdcl commented 7 years ago

Before the realization of the dragonBones mask feature, you use this way to achieve the mask is a good choice, we also think of ways to achieve the mask feature, but there are more problems to consider because of the need to unify the performance of each engine And mask mask to make a trade-off, so there is no plan to do such a feature