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

160
Views
Diferencia entre "PIXI.Texture.from()" y "nueva PIXI.Texture()" en pixi.js

Estoy trabajando para que se asignen algunas texturas a un objeto animado Sprite en Pixi.JS

El siguiente código funciona como se esperaba:

 \\ 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);

Sin embargo, lo siguiente arroja un error de "fuente no reconocida".

 \\ 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);

Mi pregunta es ¿por qué falla el segundo ejemplo [que usa PIXI.Texture.from() en lugar de "new PIXI.Texture()"] ? Los documentos indican que Texture.from() debería poder aceptar una textura base como fuente. En muchos de los tutoriales, las dos sintaxis parecen (de manera confusa) usarse indistintamente.

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!