我正在用libgdx开发一个小游戏,并在我的屏幕上我想要一个标签(包裹在一个表格中),其中会有一个可点击的文本链接(带下划线或与不同的颜色)是这样的: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);
,这让我这个
谢谢您的回答,但我已经尝试过这一点,如果添加两个标签宽度超过了表格的宽度,这是这里的情况下,它不能正常工作。此外,标签必须进行包装,以便可以在多行上显示,因为我有很长的句子要写,而不仅仅是“你可以在这里查看代码”。除了即使标签足够短,当我将它们添加到水平组时,它们也是彼此重叠(叠加)(抱歉我的英文不好)。我不知道该怎么办? – 2014-12-05 12:16:29