-
Notifications
You must be signed in to change notification settings - Fork 170
Open
Description
这段代码里,我给这个按钮添加了两张图片,显示是正常的。但是按下后就不正常了,是不是case 2里的代码有问题,这是源码
public void setImages(LTexture... images) {
LTexture[] buttons = new LTexture[4];
if (images != null) {
int size = images.length;
this.type = size;
switch (size) {
case 1:
buttons[0] = images[0];
buttons[1] = images[0];
buttons[2] = images[0];
buttons[3] = images[0];
break;
case 2:
buttons[0] = images[0];
buttons[1] = images[1];
buttons[2] = images[0];
buttons[3] = images[0];
break;
case 3:
buttons[0] = images[0];
buttons[1] = images[1];
buttons[2] = images[2];
buttons[3] = images[0];
break;
case 4:
buttons = images;
break;
default:
exception = true;
break;
}
}
if (!exception) {
this.setImageUI(buttons, true);
}
}
Metadata
Metadata
Assignees
Labels
No labels