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

431
Views
PixiJS, ¿cuál es la mejor manera de cambiar el color de un objeto Graphics?

Estoy tratando de hacer que un objeto cuadrado simple parpadee en verde, azul y rojo según diferentes condiciones. Entiendo que no hay una forma directa de cambiar el color de un objeto Graphics en PixiJS. Actualmente, creo tres objetos gráficos que son idénticos excepto por los colores. Al superponer estos objetos y ajustar la visibilidad, puedo lograr la animación intermitente.

Me preguntaba si hay una mejor manera de "cambiar" el color en lugar de engañarlo con visibilidad.

Mi código actual:

 let square_red = new PIXI.Graphics(); square.beginFill(red, opacity); square.lineStyle(lineStyle); square.drawRect(0, 0, width, height); square.position.set(x, y); let square_green = new PIXI.Graphics(); square.beginFill(green, opacity); square.lineStyle(lineStyle); square.drawRect(0, 0, width, height); square.position.set(x, y); let square_blue = new PIXI.Graphics(); square.beginFill(blue, opacity); square.lineStyle(lineStyle); square.drawRect(0, 0, width, height); square.position.set(x, y); square_red.visible = true; square_green.visible = false; square_blue.visible = false;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Podrías crear un círculo blanco y cambiar su tinte.

 const circle = new PIXI.Graphics(); circle.beginFill(0xffffff); circle.drawCircle(0, 0, 100); circle.endFill(); circle.tint = 0xff0000;
about 4 years ago · Juan Pablo Isaza Report
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!