Menakatep Posted February 17, 2020 Share Posted February 17, 2020 So, I've been struggling to get spritesheets to work in PIXI. I've got everything hosted on a webserver and have followed the instructions on the documentation for the new way with V5. Its not working and I'm not quite sure where I'm going wrong. PIXI.Loader.shared.add("images/floortiles.json").load(gameStart); function gameStart() { let sheet = PIXI.Loader.shared.resources["images/floortiles.json"].spritesheet; stage = new PIXI.Container(); renderer = PIXI.autoDetectRenderer( 800, 600, {view:document.getElementById("game-canvas")} ); } Now, I'm not sure the best way to go about using the Sprites as I'm still learning; however, I've got something that should load the correct frame from the sheet. grasstile = new PIXI.Sprite(sheet.textures['tile_2.png']); That being said, all of this was successful with separate image files. I just haven't been able to make use of the spritesheet functionality. I would GREATLY appreciate any insight you guys can provide. Thanks! ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 17, 2020 Share Posted February 17, 2020 > and have followed the instructions on the documentation for the new way with V5 Where did you see those docs? According to https://github.com/pixijs/pixi.js/wiki/v5-Migration-Guide#renderer-parameters aoptions should be the only param, "800,600" shouldn't be separate. Give me a link please, I'll fix them Your code looks fine. If moving renderer size to options dosnt help, well, I suggest you to use chrome devtools to debug- look in the console, place a breakpoint, e.t.c. . If you dont see anything strange - you can post a demo and people will look at it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.