Reputation: 51
I've been playing with PixiJS and Javascript. Now, I've been following a tutorial with a bunny(http://www.goodboydigital.com/pixi-js-tutorial-getting-started/) 5 Days ago it was working flawlessly on my PC, the bunny was loading.
Now, I'm on my laptop and it doesn't load the bunny - it never shows up. I've tried 3 different browsers. The code is completely the same. The bunny.png is in the same folder, same name and everything. I thought my code was wrong at first or something, so I then decided to just copy paste everything from the tutorial and it didn't work. It's something to do with this laptop, not sure what, running Windows 7. I've also tried running the script with the resources on my Chrome OS laptop and it didn't work.
Anyway to solve this problem?
Upvotes: 1
Views: 500
Reputation: 3706
Looks like the full path to the bunny image has to be specified. I have created a fiddle where the example works properly, you can see it yourself.
Here is the relevant part that I have changed:
// create a texture from an image path
var texture = PIXI.Texture.fromImage(
"http://www.goodboydigital.com/pixijs/bunnymark/bunny.png");
// create a new Sprite using the texture
var bunny = new PIXI.Sprite(texture);
Upvotes: 1