libgdx中的可滚动html列表 [英] Scrollable html list in libgdx

查看:126
本文介绍了libgdx中的可滚动html列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的libgdx游戏中创建成就表.我可以使用libgdx中的任何组件吗?例如,允许我将屏幕变成html页面的东西或类似的东西.

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.

推荐答案

为您启动的简单测试:

变量类别:

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();
}

查看此内容: https://github.com/libgdx/libgdx/wiki/Table

我希望我已经正确理解了,这就是你想要的.

I hope I have understood correctly, and that this is what you want.

这篇关于libgdx中的可滚动html列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆