Jump to content

Spritesheet sprite texture trying to load via url


bbyford
 Share

Recommended Posts

I'm using texture packer and adding the json like this:

Loader.add([
        path + "spritesheet-0.json?v="+version, 
        path + "spritesheet-1.json?v="+version
    ])

however when trying to create a animatedSprite the log says the textures are no valid and I see an error with a url GET of the texture name which it shouldnt be doing as it should only be getting the spritesheet.

// for each texture in animation
let texture = Texture.from(fileObject.name + (i+1) + ext);

// add to array
textureArray.push(texture);
// after for loop
character = new PIXI.AnimatedSprite(textureArray);

any help would be appreciated.

Link to comment
Share on other sites

Thanks @ivan.popelyshev think its a case of needing to talk to someone about it.. I was being an idiot and setting up my texture calls at the lowest level, same as the loader so wasn't loading the textures first ?‍♂️  Moved my code into my setup function that is called after loader finished and everything is working now ?

Edited by bbyford
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...