jkukuryk

  • Sep 9, 2024
  • Joined Aug 12, 2024
  • jkukuryk

    Hello and thanks for reaching us.

    The error you are showing is the following:

    atlas.setTextures(assetManager); //Cannot read properties of undefined (reading 'setFilters')

    That means that the TextureAtlasPage.setTexture (texture: Texture) method is receiving an undefined rather than a texture. Consequently, it fails at its first usage in texture.setFilters.

    You are calling TextureAtlas. setTextures whose code is:

    setTextures (assetManager: AssetManagerBase, pathPrefix: string = "") {
    	for (let page of this.pages)
    		page.setTexture(assetManager.get(pathPrefix + page.name));
    }

    This piece of code is responsible for setting the textures on all the atlas pages. To do that, it searches in the asset manager the respective page. Your error indicates that assetManager.get is not retrieving the texture just loaded.
    The assetManager.assets is the asset manager map that holds the assets.
    Check the page.name for each atlas page and the respective name into the assetManager.assets.

    There is another thing I noticed. SpineTexture constructor should receive a PixiBaseTexture, but you are passing a Pixi.Texture. You should use SpineTexture(pixiTexture.baseTexture).