我一直在关注这个:https://code.google.com/p/table-layout/#Quickstart,以便对LibGDX中的表进行一些介绍.我已经用按钮试验了一下.
现在我有这个代码:
Label introLabel = new Label("Skip Intro", skin);
TextField introText = new TextField("", skin);
table.add(introLabel);
table.add(introText).width(100);
table.row();
Run Code Online (Sandbox Code Playgroud)
但它抛出一个NullPointerException
因为:No com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle registered with name: default
我只将我的按钮(从屏幕上的其他位置)添加到皮肤中:
atlas = new TextureAtlas("assets/gui/buttons/alpha_generic_buttons.pack");
skin = new Skin();
skin.addRegions(atlas);
Run Code Online (Sandbox Code Playgroud)
我现在的问题是桌子需要什么样的纹理,最重要的是,如何将它们与桌子一起使用?
我已经完成了一个很好的教程,它创建了一个简单的libgdx游戏,在雨桶中捕捉雨滴.我想了解更多关于使用图像的知识,所以我尝试用婴儿替换雨滴.
当我尝试加载baby.png时,我收到以下错误:
com.badlogic.gdx.utils.GdxRuntimeException: Texture width and height must be
powers of two: 60x83
Run Code Online (Sandbox Code Playgroud)
如何加载我想要的任何尺寸的图像?