Pixi.js: Feature request: resizeTo redraw

Created on 9 Sep 2019  路  7Comments  路  Source: pixijs/pixi.js

Expected Behavior

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.

Current Behavior

Only the canvas is resized.

Environment

  • pixi.js version: 5.1.3
馃摙 Accepting PRs

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.

All 7 comments

Maybe 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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

finscn picture finscn  路  3Comments

lucap86 picture lucap86  路  3Comments

MRVDH picture MRVDH  路  3Comments

sntiagomoreno picture sntiagomoreno  路  3Comments

readygosports picture readygosports  路  3Comments