DrawText() seems to be doing too much, and its return value is confusing. I would guess the indexes are getting mixed up, but you need to use the debugger or some console logging to find it.
Do you need to index text objects numerically? It seems you could just create
scoreText = this.add.text(…);
like the others. And in collectStar(), all you really need is
scoreText.text = score;
Also, Text colors are all CSS colors (strings), e.g. 'red', 'rgb(255,0,0)', 'rgba(255,0,0,0.5)'.
I tried below just now, does not seem to change to color though?
Jesse
var redFill = 255;
var greenFill = 0;
var blueFill = 0;
var fillColor = new Phaser.Display.Color('rgb(redFill, greenFill, blueFill)'); // Is this correct? Does not seem to do anything in browser?
Texts[textIndex].color = fillColor.color;
Thank you, that worked!
I use an array of texts like a circle, when exhausted it starts again at the beginning.
Should be ok now, thanks for your help and support…