123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- class ReligionButton{
- int id;
- float x, y, w, h, a;
- boolean hover;
- boolean clicked = true;
- private float iconSize = window_w/30;
- ReligionButton(int tempid){
- id = tempid;
- x = 64/scaleAmount;
- y = 704/scaleAmount+((100/scaleAmount)*id);
- w = 75/scaleAmount;
- h = 75/scaleAmount;
-
- }
- void update(){
- if (mouseX >= x-iconSize/2 && mouseX <= x+iconSize/2
- && mouseY >= y-iconSize/2 && mouseY <= y+iconSize/2){
- hover = true;
- } else {
- hover = false;
- }
- if(hover){
- a = 255;
- iconSize = window_w/20;
- } else {
- a = 220;
- iconSize = window_w/25;
- }
-
-
- }
- void display(){
-
-
-
-
- tint(255,a);
- // if (hover){
- // image(icons[44],x,y,w*1.5,h*1.5);
- // }
- if (clicked){
- for(int i = 0; i < ipoint_c; i++){
- if(infopoints[i].religion == id){
-
-
- infopoints[i].active = true;
- ellipseMode(CENTER);
- fill(infopoints[i].religionColor);
- // stroke(100);
- noStroke();
- ellipse(map(infopoints[i].yearBegin,yearMin,yearMax,timeline.xpos,timeline.xpos+timeline.swidth), 1360.8/scaleAmount+infopoints[i].religion*(13/scaleAmount) ,5/scaleAmount,5/scaleAmount);
-
-
- }
- }
-
-
-
-
- if(id == 0){
- fill(#FDD686);
- } else if(id == 1){
- fill(#DE719E);
- } else if(id == 2){
- fill(#57BD91);
- } else if(id == 3){
- fill(#6A9FDE);
- }
- ellipse(x,y,w,h);
- } else {
- for(int i = 0; i < ipoint_c; i++){
- if(infopoints[i].religion == id){
- infopoints[i].active = false;
- }
- }
-
-
- }
- noFill();
- stroke(#FFFFFF);
- strokeWeight(1/scaleAmount);
- ellipse(x,y,w,h);
- fill(#FFFFFF);
- if(id == 0){
- shape(christian,x,y,christian.width/scaleAmount,christian.height/scaleAmount);
- } else if(id == 1){
- shape(buddhism,x,y,buddhism.width/scaleAmount,buddhism.height/scaleAmount);
- } else if(id == 2){
- shape(islam,x,y,islam.width/scaleAmount,islam.height/scaleAmount);
- } else if(id == 3){
- shape(jew,x,y,jew.width/scaleAmount,jew.height/scaleAmount);
- }
-
-
- }
- }
|