let app = new PIXI.Application({ autoStart: true, width: 640, height: 480 });
PIXI.loader.resoures.add("./spritesheet.json");
/* creates a Texture using the ENTIRE spirtesheet image instead of reading from json and cropping it to texture atlas */
let testTexture = new PIXI.Texture(PIXI.loader["./spritesheet.json"].textures["player2.png"]);
//work around : new PIXI.Texture(PIXI.loader["./spritesheet.json"].textures["player2.png"],PIXI.loader["./spritesheet.json"].textures["player2.png"].orig); or by using .frame
/* What's the point of passing ["player2.png"], specifying the texture atlas location if it's just going to use the entire image when creating calling new PIXI.Texture . */
let testSprite = new PIXI.Sprite(testTexture);
/* this corrects the sprite with the correct frames though referencing the texture in the loader*/
let testTexture2 = PIXI.loader["./spritesheet.json"].textures["player2.png"].texture;
let testSprite2 = new PIXI.Sprite(testTexture2); //correct crop refferencing texture atlas frame.
I know how to work around this but shouldn't "new PIXI.Texture" reach into the json file and grab the correct location of the image rather than use the entire image of the spritesheet?