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

228
Vistas
Phaser 3 How to fill Phaser.Curves.Path with color?

Hey! Could anyone help me please, I have some troubles with rendering custom Path to RenderTexture

How to fill the Path with color??

I have prepared sandbox example for my problem: https://stackblitz.com/edit/set-bounce-phaser-3-so-ixfkeq Here is the code sample:

function create() {
  this.add.image(400, 300, 'sky');

  graphics = new Phaser.GameObjects.Graphics(this);
  graphics.lineStyle(4, 0x00ff00);
  graphics.fillStyle(0x00ff00); // how to fill it??

  rt = this.add.renderTexture(100, 100, 100, 100).setOrigin(0.5);

  var circle = this.add
    .circle(0, 0, 50, 0xff7e00)
    .setAlpha(0.8)
    .setVisible(false);

  rt.draw(circle, 50, 50);

  // This is just example, I need complex path with curves
  const path = new Phaser.Curves.Path(); // how to fill it??
  path.lineTo(50, 0);
  path.lineTo(50, 50);
  path.lineTo(0, 50);
  path.closePath();
  path.draw(graphics);
  rt.draw(graphics, 25, 25);
}

With this code I can see filled circle and only stroke for the Path

enter image description here

What did I miss ?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Answer is found!

graphics.fillPoints(path.getPoints())
about 4 years ago · Juan Pablo Isaza Denunciar
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