Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

Issue with masking transparent sprite

$
0
0

Hi everyone,

I began looking for ways today to recreate this affect:

85SJACY.png

 

Theres a red image, a blue image, and the black is where the overlap. I wanted a draggable canvas where the black area appeared as you dragged the blue image around over the red one.

I immediately thought to use pixijs and began looking into masking the black image.

Here is what I came up with: https://www.pixiplayground.com/#/edit/7~KRCG4gBR_GmsYZVSUsn  (The transparent images appear to have problems in pixiplayground but they are working in my project's implementation).

All 4 image links, the red, blue, black(black version of red) and mask(black version of blue) can be found in the playground above.

If I apply a Graphic mask of just a black rectangle it works fine - but shows all of the black image of course. But if I use a black version of the blue image as a mask, the black image just never appears.

Should I be masking this for a sprite mask with transparency a different way?

 

Any help is appreciated. 


Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>