-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcharacter.java
More file actions
42 lines (38 loc) · 1.49 KB
/
character.java
File metadata and controls
42 lines (38 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package Project;
import javax.swing.*;
import java.awt.*;
public class character{
public int id;
public String name="";
public ImageIcon [] lihui=new ImageIcon[233];//0为选人界面立绘,1为常态立绘,2为标记成功立绘,3为被炸立绘,4为胜利立绘,5为失败立绘,6为标记失败 350*800
public character(int i){
id=i;
String t="";
if(id==1) {
name="乐园的巫女————博丽 灵梦";
for(int j=0;j<=6;j++) {
t="Project/lm"+(char)(j+'0')+".png";
lihui[j]=change(new ImageIcon(t),350,750);
}
}
if(id==2) {
name="普通的魔法使————雾雨 魔理沙";
for(int j=0;j<=6;j++) {
t="Project/mls"+(char)(j+'0')+".png";
lihui[j]=change(new ImageIcon(t),350,750);
}
}
if(id==3) {
name="七色的人偶使————爱丽丝 玛格特罗伊德";
for(int j=0;j<=6;j++) {
t="Project/alc"+(char)(j+'0')+".png";
lihui[j]=change(new ImageIcon(t),350,750);
}
}
}
public ImageIcon change(ImageIcon image, int Iwidth, int Iheight) {
Image img = image.getImage().getScaledInstance(Iwidth, Iheight, Image.SCALE_DEFAULT);//第三个值可以去查api是图片转化的方式
ImageIcon image2 = new ImageIcon(img);
return image2;
}
}