user1762507
user1762507

Reputation: 782

How to set color of text letters individually?

How would I make text so that each letter is a random color in andengine GLES 2? For the random color I could go

int red = (int) (Math.random() * 254) + 1;
int green = (int) (Math.random() * 254) + 1;
int blue = (int) (Math.random() * 254) + 1;
Color pColor = new Color(red, green, blue);

but how can I set this to each letter individually?

Upvotes: 0

Views: 799

Answers (1)

jmroyalty
jmroyalty

Reputation: 2527

each letter would have to be it's own Text and set each one's color randomly - just do it

and when you create the Text, set the color to white on creation, then change it to your random color

BTW, there is no way (that I am aware of) to do it in a single Text

Upvotes: 4

Related Questions