Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

PixiJS Spritesheet sometimes doesn't load (appears as as a blue background)

$
0
0

Hello,

I am experiencing a weird glitch in which spritesheets don't load properly sometimes (every 5th time?) and it shows up as just blue empty background.

Here is my code:

var frames = []
for (let i = 0; i < 48; i++) {
    frames.push("spritesheets/frame/" + (i+1) + ".png")
}

myApp.background = new PIXI.AnimatedSprite.fromFrames(frames);
myApp.background.width = Constants.WIDTH;
myApp.background.height = Constants.HEIGHT;
myApp.background.x = myApp.renderer.renderer.width / 2 - Constants.WIDTH / 2;
myApp.background.y = myApp.renderer.renderer.height / 2 - Constants.HEIGHT / 2;

myApp.renderer.stage.addChild(myApp.background);
myApp.background.animationSpeed = 0.125;
myApp.background.play();                       
                       
                       

I hope you can help me!


Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>