Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: resizeTo redraw #6081

Closed
fvonellerts opened this issue Sep 9, 2019 · 7 comments · Fixed by #6415
Closed

Feature request: resizeTo redraw #6081

fvonellerts opened this issue Sep 9, 2019 · 7 comments · Fixed by #6415
Labels
📢 Accepting PRs Would welcome a PR from the community.

Comments

@fvonellerts
Copy link

fvonellerts commented Sep 9, 2019

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
@bigtimebuddy
Copy link
Member

Maybe a resize event on the Application’s 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’re experiencing.

@fvonellerts
Copy link
Author

Yes maybe or a proxy variable, if that's possible. The same way CSS has vw and vh.

Ok I will try.

@bigtimebuddy bigtimebuddy added the 📢 Accepting PRs Would welcome a PR from the community. label Sep 9, 2019
@bigtimebuddy
Copy link
Member

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.

@eXponenta
Copy link
Contributor

eXponenta commented Sep 10, 2019

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.

@fvonellerts
Copy link
Author

@eXponenta Yes, relative positions.
@bigtimebuddy Sure.

@bigtimebuddy
Copy link
Member

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.

@stale
Copy link

stale bot commented Dec 9, 2019

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.

@stale stale bot added the Stale Previously “Won’t Fix”, bots should tag with this for inactive issues or pull-requests. label Dec 9, 2019
@stale stale bot closed this as completed Dec 23, 2019
@bigtimebuddy bigtimebuddy reopened this Feb 16, 2020
@stale stale bot removed the Stale Previously “Won’t Fix”, bots should tag with this for inactive issues or pull-requests. label Feb 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📢 Accepting PRs Would welcome a PR from the community.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants