Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Can a spritesheet be loaded in the scene config or does it need to be in preload


squilibob
 Share

Recommended Posts

Can a spritesheet be loaded in the scene config or does it need to be in preload?

I have a spritesheet that I have set up in my preload function

preload: function() {
    this.load.spritesheet({
        key: 'defaultavatars',
        url: '/img/avatars.png',
        frameConfig: { frameWidth: 256, frameHeight: 256, endFrame: 49 }
    })
}

Is there a way I can add it in the scene config using the new pack declaration?

pack: {
      files: [
          { type: 'image', key: 'defaultavatars', url: 'img/avatars.png', frameConfig: { frameWidth: 256, frameHeight: 256, endFrame: 49 }}
      ]
}

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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