¡Oye! ¿Alguien podría ayudarme, por favor? Tengo algunos problemas para renderizar una Path personalizada a RenderTexture
Como llenar el Camino de color??
He preparado un ejemplo de sandbox para mi problema: https://stackblitz.com/edit/set-bounce-phaser-3-so-ixfkeq Aquí está el ejemplo de código:
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); }Con este código, puedo ver un círculo relleno y solo un trazo para la ruta
Qué me perdí ?
¡Se encontró la respuesta!
graphics.fillPoints(path.getPoints())