You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PIXI.Loader.shared.add("sprites/spritesheet.json")
.load(spriteSetup)
.load(startup);
function spriteSetup(){
sheet = PIXI.Loader.shared.resources["sprites/spritesheet.json"].spritesheet;
}
function startup(){
bunny = new PIXI.Sprite(sheet.textures["bunny.png"]);
}
Current Behavior
The console.log is returning "sheet is undefined". I look in the console and
'PIXI.Loader.shared.resources["sprites/spritesheet.json"]'
returns an object. but the .spritesheet property doesn't exist. This is how the official documentation says to load in spritesheets, right? Am I missing something obvious here, or does pixi no longer have the ability to load sprites from a spritesheet?
This is because you're trying to run the html file from your PC; browsers don't like that. You must run it through a web server. npm i -g http-server@0.9.0
then npm run http-server
in the directory where your index.html file is. Then it all works fine for me
This is because you're trying to run the html file from your PC; browsers don't like that. You must run it through a web server. npm i -g http-server@0.9.0
then npm run http-server
in the directory where your index.html file is. Then it all works fine for me
@themoonrat
Ah you're totally right, thanks babe. ;; I was actually running http-server already, but the problem was that firefox by default doesn't open local files in localhost:8080 like it used to, so I actually had to navigate to "localhost:8080" in the URL bar for everything to work.
Picture of the Error I'm Experiencing
Expected Behavior
Creating and accessing a spritesheet using PIXI 5.1 and following the documentation exactly:
http://pixijs.download/release/docs/PIXI.Spritesheet.html
Current Behavior
The console.log is returning "sheet is undefined". I look in the console and
'PIXI.Loader.shared.resources["sprites/spritesheet.json"]'
returns an object. but the .spritesheet property doesn't exist. This is how the official documentation says to load in spritesheets, right? Am I missing something obvious here, or does pixi no longer have the ability to load sprites from a spritesheet?
Possible Solution
Steps to Reproduce
Environment
pixi.js
version: 5.1.0The text was updated successfully, but these errors were encountered: