Skip to content

SVG guide shows incorrect Assets.load code #167

@electrovir

Description

@electrovir

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
}
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions