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
Changing the Renderer's Resolution #3810
Comments
The best temporary workaround that I came up with is to destroy and re-create the renderer, passing the new resolution to autoDetectRenderer. This works but maybe isn't the most efficient way to do it. Also, there's maybe still an issue with repeatedly destroying and re-creating the renderer: #2233 It seems like there should be a simple function call to do this, like renderer.setResolution, that minimizes the amount of extra processing and dead resources. |
Hi @jaspervaz! Curious about what is your use-case for this is? |
Yes, it is. I will make that function later, but this might work for now:
Don't forget to update ALL FILTERS RESOLUTIONS. |
And don't forget to update the interaction plugin resolution too |
@jaspervaz EXACTLY, Zoom changes, that's what i want to do too :) |
Check like this to make it work for both renderers:
Also, it seems to work the same without the following line, I think because zooming changes both the resolution and the window dimensions, but maybe other use cases require it:
|
Yes, I agree. |
@ivanpopelyshev I want to scale the screen. |
@starInEcust Why do you need resolution more than 20? Resolution is not about scaling, its browser zoom. Scale is part of stage transform. |
@ivanpopelyshev I want to enlarge the the renderer and keep the text and svg pictures won't be distorted |
@starInEcust I solved that kind of issues by manual adjusting of scale and font size. There's also new solution: use SDF fonts. https://github.com/PixelsCommander/pixi-sdf-text |
@ivanpopelyshev how about svg? I just want to make a text editor with cool animation, in the print preview can zoom in and out, but does not affect the typesetting. |
That's very unusual use-case for pixi. You have to change zoom through "stage.scale" and adjust resolution only of SVG and text, not the resolution of whole renderer. In your case screen size of renderer is fixed, and when you change resolution, canvas dimensions are becoming too big, you're hitting 16k x 16k pixels size! I didnt use SVG in pixi so I dont know how to adjust resolution for it :) |
Thank you very much!Maybe I should open an issue to discuss this question :( |
Going to close this issue since it seems answered, feel free to open another if you have another question! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Is there a way to update the renderer's resolution? I tried renderer.resolution = window.devicePixelRatio, but it just makes the screen flash white.
The text was updated successfully, but these errors were encountered: