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

148
Vistas
mask can not moved and resize in PIXIJS

I want to manipulate masks in PIXIJS. I wrote the code based on the official example. (https://pixijs.io/examples/#/masks/sprite.js).

const app = new PIXI.Application({
    width: $(window).innerWidth(),
    height: $(window).innerHeight(),
    backgroundColor: 0x000000,
    antialias: true,
    
});

app.stage.hitArea = app.screen;
app.stage.interactive = true;
const rect = new PIXI.Graphics().beginFill(0xff0000,1).drawRect(0,0, 500, 500).endFill();
const sprite = PIXI.Sprite.from('Assets/UI/play.png');
sprite.x = 250;
sprite.y = 250;
rect.mask = sprite;

app.stage.addChild(rect);

I moved sprite, but it did not move from (0,0). this image shows the result of the execution. How do I move or resize the mask? thank you.

PIXIJS:6.2.0 Running with webpack and babel.

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