https://pixijs.com/8.x/guides/basics/svg
|
```ts |
|
const svgTexture = await Assets.load('path/to.svg', { |
|
resolution: 4 // will be 4 times as big! |
|
}); |
|
const mySprite = new Sprite(svgTexture); |
|
``` |
Assets.load expects a callback for it second argument. This code fails.
I tracked down what the example code is actually doing, and I see now that the first input to Assets.load can be an object:
|
const tigerTexture = await Assets.load({ |
|
src: 'https://pixijs.com/assets/tiger.svg', |
|
data: { |
|
resolution: 4 |
|
} |
|
}); |
https://pixijs.com/8.x/guides/basics/svg
pixijs.com/docs/guides/basics/svg.mdx
Lines 63 to 68 in 2897bc3
Assets.loadexpects a callback for it second argument. This code fails.I tracked down what the example code is actually doing, and I see now that the first input to
Assets.loadcan be an object:pixijs.com/docs/examples/graphics/svg-texture-large.js
Lines 14 to 19 in 2897bc3