【发布时间】:2014-05-29 23:17:42
【问题描述】:
我正在尝试使用 Table 类创建游戏内窗口。但是当我将图像组添加到该表时,似乎 row() 方法对组没有影响,它们都在同一个地方。使用图像而不是组有效。 PS。我使用 Group 来重叠图像(有点悬停效果的边框),不知道更好的方法。 谢谢
public class MyGroup extends Group{
public MyGroup(Image bg, Image thumb){
this.addActor(bg);
this.addActor(thumb);
}
}
public class ActionScreen extends Table {
MyGroup[] group =new MyGroup[8];
for (int i=0;i<8;i++){
group[i] = new MyGroup(new Image(skin.getDrawable("item-bg")),new Image(skin.getDrawable("item-bg-over")));
if (i==4){
row();
add(group[i]).top().padLeft(100);
}
else{
add(group[i]).top().padLeft(100);
}
}
【问题讨论】:
标签: java user-interface libgdx scene2d