Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

174
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!