How to change color of graphics once created?

Hi phaser’s guys,
Is it possible to change the color of a graphics once it has already been created?

The fillStyle Method (mygraphics.fillStyle(0x44ff44,1) as defined in https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Graphics.html doesn’t seem to work in this case : In fact I guess the fillStyle Method is functionnal only for graphics instantiation…

Thanks for any help!

Graphics have to be cleared and redrawn.

1 Like

Thanks, that’s what I thought… I dont understand why this possibility has not been implemented…

You can use a Shape instead, maybe.

2 Likes

It works with a shape and setFillStyle. thanks for this solution.

1 Like