Jump to content

bulge filter


ap_dev
 Share

Recommended Posts

When adding a bulge filter to a container, and setting the center property to [0.5,0.5], the center point is defined as the average of all children positions (for my use at least). I'd like to have it be set to the center, as that's why I have it assigned to a container and not the sprites. Is this expected behavior and is there a way to set the center point to the container?

Link to comment
Share on other sites

its expected behaviour, because on its own container doesnt have width or height. Its not DOM, its a tree of transforms, width/height are secondary. There's no way to calculate where is "center of container" except look at its children.

Even more, (0.5, 0.5) in case of this filter means center of filter area that appears on screen. If container has a part outside screen, its culled out, and center moves.

If you want to specify pixel coords in local container coords, I'm afraid that you have to read https://github.com/pixijs/pixi.js/wiki/v5-Creating-filters and make your own version of that filter.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...