class Link { private String title; private int x; private int y; private int w = 40; private int h = 5; public Link(String title,int x,int y,int w,int h){ this.title = title; this.x = x; this.y = y; this.w = w; this.h = h; } void display(){ if(isOver()){ fill(255,0,0); }else{ fill(0); } textAlign(LEFT); text(title,x,y); } private boolean isOver(){ return mouseX >= x && mouseX <= x+w && mouseY <= y && mouseY >= y-h; } }