Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

176
Vistas
Difference between "PIXI.Texture.from()" and "new PIXI.Texture()" in pixi.js

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.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda