forked from bsondermann/BlackboxSticksExporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LangImage.pde
34 lines (31 loc) · 866 Bytes
/
LangImage.pde
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
class LangImage{
PImage image;
PVector pos;
String name;
boolean mdown=false;
XML xml;
BlackboxSticksExporter bbse;
LangImage(File f,PVector pos,BlackboxSticksExporter s){
this.bbse=s;
image = loadImage(f.getAbsolutePath());
name = f.getName().substring(0,f.getName().length()-4);
this.pos = pos;
xml = loadXML(sketchPath()+"/assets/data.xml");
}
boolean update(){
boolean ret = false;
if(mouseY>pos.y-15&&mouseY<pos.y+15&&mouseX>pos.x-25&&mouseX<pos.x+25&&mousePressed&&mdown!=true){
mdown=true;
xml = loadXML(sketchPath()+"/assets/data.xml");
xml.getChildren("data")[4].setContent(name);
saveXML(xml,sketchPath()+"/assets/data.xml");
setup();
ret = true;
}
if(!mousePressed){mdown=false;}
return ret;
}
PImage getImage(){
return this.image;
}
}