iibrahimbakr
iibrahimbakr

Reputation: 1134

libGDX : Multi-color text in one label

I saw this post Multi-colored text in libgdx but it's not useful specially in new API.

For example: I want to color "libGDX" text like this: enter image description here

BitmapFont font = new BitmapFont(Gdx.files.internal("fonts/CarterOne.fnt"));
LabelStyle style = new LabelStyle(font, null);
Label label = new Label("libGDX", style);
stage.addActor(label);

How can I do this ?

Upvotes: 11

Views: 3470

Answers (1)

noone
noone

Reputation: 19776

You can do this easily with the color markup language that Label supports as well.

Make sure to read that article completely, as there are a few little obstacles involved to get it working.

Upvotes: 15

Related Questions