我正在用libgdx开发一个小游戏,在我的屏幕上我希望有一个标签(包裹在一个表格中),其中有一个可点击的文本链接(带下划线或颜色不同),如下所示:
您可以在此处查看代码
编辑:
我试过的是:
HorizontalGroup monGroup = new HorizontalGroup();
Label howRotationRep = new Label("They have been based on the information provided on this ", new Label.LabelStyle(game.petiteFont, Color.WHITE));
howRotationRep.setWrap(true);
howRotationRep.setWidth(tailleCell);
Label test = new Label(" site", new Label.LabelStyle(game.petiteFont, Color.RED));
test.addListener(new ClickListener(){
@Override
public void clicked(InputEvent event, float x, float y) {
Gdx.net.openURI("http://tetrisconcept.net/wiki/SRS");
}
});
monGroup.addActor(howRotationRep);
monGroup.addActor(test);
table.add(monGroup).left().width(tailleCell);
Run Code Online (Sandbox Code Playgroud)
它给了我这个
