flekschas/piling.js

On temp depile: adjust opacity of entire pile, individual items

Closed this issue · 4 comments

It looks cool but I don't think it's useful as faded-out piles with large numbers of items are just too noticeable:

Screen Shot 2020-04-26 at 5 26 58 PM

I'm sorry, but do you mean to adjust the opacity of the pile or individual items or both? Right now I'm adjusting the opacity of the pile's rootContainer, see https://github.com/flekschas/piling.js/blob/master/src/library.js#L3746.

Interesting. Maybe I caused the visual change by replacing the graphics element with a container 🤔 Can you do a quick test to see if changing the root container back to a graphics object would change the visual output?

Essentially, instead of having the opacity of every individual item adjusted, the opacity of the pile as a whole should change.

No, the issue still exists. Actually I think the issue existed all the time.

I found this issue on pixi's github that might be related: pixijs/pixijs#4334

I think there's a very easy workaround:

  1. Add dispersed pile to a separate container that sits on top of normal piles (can we use activePile?)
  2. Add a container in between normal piles and the dispersed pile with a single black sprite texture. Set the transparency of that texture to 0.66 or somethings

To get a black sprite do

const blackSprite = new PIXI.Sprite(PIXI.Texture.WHITE);
blackSprite.tint = 0x000000;
blackSprite.width = containerWidth;
blackSprite.height = containerHeight;