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
Allow passing BaseTexture options to Loader #7183
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #7183 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 17 17
Lines 699 699
=========================================
Hits 699 699 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works!
Though it needs unit-tests for loader
+1 for error Handling problems
I have some ideas how to handle resource errors and bubble them up to the loader. Will work on that next. But yes on unit tests. Will add. |
Okay I added unit-tests which uncovered an async error with SVGs. Basically, I needed to wait until the resource was completely finished loading before continuing with the Loader. |
Good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
How can I zoom in on svg sharply and control the gpu to slow it down? |
Its possible, but so far people who did it didnt share :) If you give a demo that needs quality - someone can do that. From grounds up? sorry, no. |
You could use @pixi-essentials/svg for sharp rendering of SVG files |
When the number of svg paths is high and the use tag is used, it becomes very slow and does not support the pattern. |
Well, there is no way I can better display svg with resolution and scaled when zooming |
I think you can increase the width/height of the SVG, and then create a texture from it at that higher size |
Fixes #7148
Now BaseTexture options can be passed to the metadata field.
🔥 Breaking Change
<img>
element, SVGs are loaded as text with resource-loader, and parsed with SVGResource.🔬 Demos
https://jsfiddle.net/bigtimebuddy/gs6d81qk/ (png)
https://jsfiddle.net/bigtimebuddy/qwb6nduv/ (svg)
Follow-up Needed
fromLoader
function. I suggest we return a Promise likefromUrl
, and make sure the Loader does not swallow errors.