Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: masking in PIXI (blendmode alpha) #44

Open
bitbay opened this issue Oct 30, 2017 · 1 comment
Open

FEATURE: masking in PIXI (blendmode alpha) #44

bitbay opened this issue Oct 30, 2017 · 1 comment

Comments

@bitbay
Copy link

bitbay commented Oct 30, 2017

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:

  • differentiate between displays of type PIXI.Sprite and Armature (PIXI.Container)
  • ...rendering the Containers content into a local texture before applying it as mask (Container types can't be currently used as masks)
  • apply the mask to any underlying Slot/Armature, using z-order to determine the masking target.

Do You have any plans to add support for this?

@akdcl
Copy link
Member

akdcl commented Nov 6, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants