7
Ho visto questo post Multi-colored text in libgdx ma non è particolarmente utile nella nuova API.libGDX: testo multicolore in un'etichetta
Per esempio: voglio colorare "libGDX" testo come questo:
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);
Come posso fare questo?
Non ho trovato ostacoli :) è molto semplice 'font.getData(). MarkupEnabled = true; \t \t Stile LabelStyle = new LabelStyle (font, null); \t \t Etichetta etichetta = nuova etichetta ("[# ff0000] l [# 30ff00] i [# 1effff] b [# fff600] G [# ff00ae] D [] [# ff9000] X", stile); ' GRAZIE MOLTO @noone – Crowni