question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to use spritesheet textures?

See original GitHub issue

Hello I have a problems with the model textures. If the texture comes from a spritesheet, the model displays the whole spritesheet instead of the proper texture. Here is the code, which I am using. Note that everything works perfectly fine, if I pass a ‘standalone’ texture.

    public setTexture(meshIndex: number, texture: Texture) {
        let mat = this.model.meshes[meshIndex].material as StandardMaterial;
        mat.baseColorTexture = texture;
    }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jnsmalmcommented, Nov 14, 2021

Added automatic support for spritesheet textures, will come in next release.

0reactions
djlastnightcommented, Dec 5, 2021

Yes, and actually runs very efficient and fast. I left the game loop the animations for 8 hours and the memory usage did not change at all. Is there a better (built-in) way doing this? I did not find something like AnimatedSprite3D, so I had to do it myself by applying tweens.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to import Textures and Images from a sprite sheet?
We can import Sprites from a sprite sheet using SpritePackedManager. But I could not find any clear-cut way to import Texture or ...
Read more >
What is the difference between a sprite sheet and a texture ...
tl;dr : Yes that is absolutely correct. Sprites Sheets often mean a large set of some specific charater's animation frames or multiple ...
Read more >
Spritesheets - PixiJS
SpriteSheets help your project in two ways. First, by speeding up the loading process. While downloading a SpriteSheet's texture requires moving the same ......
Read more >
Sprites and textures (SFML / Learn / 2.5 Tutorials)
Using as few textures as possible is a good strategy, and the reason is simple: Changing the current texture is an expensive operation...
Read more >
TexturePacker - Create Sprite Sheets for your game!
Sometimes it's necessary to use the same sprite multiple times, e.g. in an animation. TexturePacker detects these identical sprites and only adds them...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found