essentialskills

It appears that I can only use 1 texture alias png when using the widget code. Or else I get this error.

Uncaught TypeError: Cannot read property 'setFilters' of undefined
at TextureAtlas.load (TextureAtlas.ts:79)
at new TextureAtlas (TextureAtlas.ts:34)
at SpineWidget.load (Widget.ts:162)
at Widget.ts:191

In order for my animations to work on older devices such as the IPad 2, I need to save the texture at 1024x1024. (We work with schools that have old devices) However, my texture has a bunch of frames and trying to fit all that in 1 texture alias png makes for a really blurry animation. I am using the example code in spine-ts/widget/example to display my animation. If I export anything from spin with more then 1 texture alias page it crashes.

Is there a way to use multiple texture alias pngs when using the widget code? And if not then why not?
essentialskills
Posts: 10

Erikari

Hello, you can have multiple atlas pages using the Javascript configuration, and you will have to specify the location of each page png:
spine-runtimes/spine-ts at 3.6
atlasPages: optional, the list of atlas page images, e.g. atlasPages: ["assets/page1.png", "assets/page2.png"] when using code, or data-atlas-pages="assets/page1.png,assets/page2.png" on case of HTML instantiation. Use this if you have a multi-page atlomittedommited, only one atlas page image is loaded based on the atlas file name, replacing .atlas with .png.
User avatar
Erikari

Erikari
Posts: 1332

essentialskills

That worked! I just assumed the atlas file knows that the textures are on multiple pages and therefore it would of loaded them without me explicitly telling it too. When I open the atlas file I can see it knows the correct png files to grad. Is there an advantage to this way?
essentialskills
Posts: 10

badlogic

No, that's just a sillyness of the widget. We are working on a new simple player for animations that does all this automatically. It's being worked on in the 3.7-beta branch under spine-ts/widget/. I see if I can make the old widget use the new loading code as well.
User avatar
badlogic

Mario
Posts: 1448


Return to Editor