If a PIXI Application has a resizeTo element, it would be nice if the element positions inside the application would also update when resizing. Plus some throttling on the resize event would help avoid performance problems.
If this functionality is too complicated to implement (or already present), a best practice example of a responsive application would be very helpful.
Only the canvas is resized.
pixi.js version: 5.1.3Maybe a resize event on the Application鈥檚 renderer and/or stage Container would be good? So you could respond to resize events from there and pass them to your children display objects.
Also, would welcome a resize throttle PR to fix that performance issue you鈥檙e experiencing.
Yes maybe or a proxy variable, if that's possible. The same way CSS has vw and vh.
Ok I will try.
Adding a resize event is a good start and would be a simple PR if you or someone wants to take a stab at it.
Yes maybe or a proxy variable, if that's possible. The same way CSS has vw and vh.
What are you mean? Add relative position to Container element?
It is very bad idea implement layout system direct in core.
There is some Objects can't supported auto layouting, such as Graphics or Rope.
It mus be implemented in plugin outside pixi package.
@eXponenta Yes, relative positions.
@bigtimebuddy Sure.
I agree that layout should be a plugin and not implemented directly in core. But the resize event could pass along the width/height, viewport and frame of the renderer. Should be more than enough to calculate anything you need relatively.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
Adding a resize event is a good start and would be a simple PR if you or someone wants to take a stab at it.