T
T
Triborg-3332021-02-19 12:20:36
JavaScript
Triborg-333, 2021-02-19 12:20:36

Creating textures from PIXI.Text?

Hello, how to create a texture from PIXI.Text ?

const app = new PIXI.Application({ 
      width: window.innerWidth,         // default: 800
      height: window.innerHeight,        // default: 600
      antialias: true,    // default: false
      transparent: false, // default: false
      resolution: 1,      // default: 1
      backgroundColor:0xEB4C42
  }
);
    
app.renderer.view.style.position = "absolute";
app.renderer.view.style.display = "block";
app.renderer.autoResize = true;
app.renderer.resize(window.innerWidth, window.innerHeight);
    
document.body.appendChild(app.view);
    
app.stage.interactive = true;
app.stage.sortableChildren = true;

let texture = new PIXI.Text('Hello!').texture;
let sprite = new PIXI.Sprite(texture);


app.stage.addChild(sprite);


doesn't work like that :(

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