问题
I want to make achievements table in my libgdx game. Is there any component in libgdx wchih i can use? For example something that allows me to turn screen into html page or something like this.
回答1:
simple test for you start:
Variable Class:
Stage stage;
ScrollPane scrollPane;
Table outerTable, innerTable;
.
@Override
public void show() {
stage = new Stage();
outerTable = new Table();
innerTable = new Table();
image = new Image(new Texture(
Gdx.files.internal("badlogic.jpg")));
//innerTable.add(YourActor); for example Image, or TextButton
innerTable.add(image);
scrollPane = new ScrollPane(innerTable);
outerTable.setPosition(0, 0);
outerTable.setSize(Gdx.graphics.getWidth(),Gdx.graphics.getHeight());
outerTable.debug();
outerTable.add(scrollPane).fill().expand();
stage.addActor(outerTable);
}
@Override
public void render(float delta) {
Gdx.gl20.glClearColor(0, 0, 0, 1);
Gdx.gl20.glClear(GL20.GL_COLOR_BUFFER_BIT);
stage.act(delta);
stage.draw();
}
look this: https://github.com/libgdx/libgdx/wiki/Table
I hope I have understood correctly, and that this is what you want.
来源:https://stackoverflow.com/questions/28592083/scrollable-html-list-in-libgdx