ap_dev Posted June 26, 2020 Share Posted June 26, 2020 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? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 28, 2020 Share Posted June 28, 2020 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.