I am working on getting some textures assigned to an animatedSprite object in Pixi.JS
The below code works as expected:
\\ previously loaded: APP.loader.add("tile_sheet", "img/tile_spritesheet.png");
const texture_base = PIXI.BaseTexture.from(APP.loader.resources["tile_sheet"].url);
const texture_1 = new PIXI.Texture(texture_base);
const component = PIXI.AnimatedSprite.from(texture_1);
However the following throws a "unrecognized source" error.
\\ previously loaded: APP.loader.add("tile_sheet", "img/tile_spritesheet.png");
const texture_base = PIXI.BaseTexture.from(APP.loader.resources["tile_sheet"].url);
const texture_1 = PIXI.Texture.from(texture_base);
const component = PIXI.AnimatedSprite.from(texture_1);
My question is why does the second example [which uses PIXI.Texture.from() rather than "new PIXI.Texture()"] fail? Docs state Texture.from() should be able to accept a base texture as a source. In many of the tutorials the two syntaxes appear (confusingly) to be used interchangeably.