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

Sprite not rendering when I add it's image texture to a folder

$
0
0

I am having a really weird issue. I am creating a sprite from an image as follows:

var grid1_texture = new PIXI.Texture.fromImage("whiteSquare.jpg");

Now this works fine and I am able to add this to the stage. I basically want to add all my images to a folder called resources. So I changed the code to this:

var grid1_texture = new PIXI.Texture.fromImage("/resources/whiteSquare.jpg");

When I do this, I can see in Brackets editor that the link is being made however, the sprites do not get rendered on the stage.

Please help!


Viewing all articles
Browse latest Browse all 3978

Trending Articles



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