Hey everyone, new guy here
Is it possible to load an SVG file that is also a spritesheet using the typical this.load.pack procedure in a scene’s preload?
So far I’ve tested this (among other attempts that also didn’t work) :
{
"type": "spritesheet",
"key": "mysvg",
"url": "./mysvg.svg",
"svgConfig":{
"width":200,
"height":200
},
"frameConfig": {
"frameWidth": 100,
"frameHeight": 100
}
}
It seems to be loading only the first frame, meaning that when I add a new sprite, no matter what index I use, it still shows the one at position 0.
Any ideas?
Edit:
Upon further investigation I have concluded that the reason this isn’t working is because it’s not looking at the “svgConfig” property due to the fact that it’s being loaded as a spritesheet.
The only workaround that I thought was adding the extension property like so, but it also didn’t work:
{
"type": "spritesheet",
"key": "mysvg",
"url": "./mysvg.svg",
"extension": "svg",
"svgConfig":{
"width":200,
"height":200
},
"frameConfig": {
"frameWidth": 100,
"frameHeight": 100
}
}
Note that I need the size override for the SVG and loading a separate file isn’t an option I’d like to go with.