Exemple #1
0
 // NOTE: should be implemented outside of function, and not using a function
 public virtual bool mouseWithin(MouseInfo e)
 {
     if (e.getX() > xPos && e.getX() <= xPos + width && e.getY() > yPos && e.getY() <= yPos + height)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemple #2
0
 public bool mouseWithin(MouseInfo e)
 {
     return(topLeftX <= e.getX() && topLeftX + width > e.getX() &&
            topLeftY <= e.getY() && topLeftY + height < e.getY());
 }