G
G
GNG9992021-12-26 11:02:16
JavaScript
GNG999, 2021-12-26 11:02:16

How to write json keys in function parameters in PixiJS in webpack?

Hello ! Installed Pixi Js in webpacke (I took create-react-app as the webpack version)
Wrote the following code

loader.add('hunter',"./images/dng.json").load(setup); 

function setup() {
  const texture = PIXI.Texture.from('blob_1.png') // blob_1.png -один из ключей в dng.json
  console.log(texture)
  const sprt = new Sprite(texture)
  sprt.position.set(50,50)
  console.log(sprt)
  app.stage.addChild(sprt)
  }


I get an error

61c82132245c6112590371.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question