我想让一个图像按钮出现在面板中,但什么也没画。
这是我的代码:
skin = new Skin(Gdx.files.internal("uiskin.json"));
texture1 = new Texture(Gdx.files.internal("badlogicsmall.jpg"));
texture2 = new Texture(Gdx.files.internal("badlogic.jpg"));
TextureRegion image = new TextureRegion(texture1);
TextureRegion imageFlipped = new TextureRegion(image);
imageFlipped.flip(true, true);
TextureRegion image2 = new TextureRegion(texture2);
ImageButtonStyle style = new ImageButtonStyle(skin.get(ButtonStyle.class));
style.imageUp = new TextureRegionDrawable(image);
style.imageDown = new TextureRegionDrawable(imageFlipped);
ImageButton iconButton = new ImageButton(style);
style.imageUp = new TextureRegionDrawable(image);
style.imageDown = new TextureRegionDrawable(imageFlipped);
任何帮助表示赞赏!
提前致谢 !