示例#1
0
 public void setVisible(boolean visible) {
   this.visible = visible;
   if (visible) {
     redraw();
   } else {
     layer.canvas().clear();
   }
 }
示例#2
0
 private boolean pointInButton(float x, float y) {
   if (!visible()) {
     return false;
   }
   return (x >= transX
       && y >= transY
       && x <= transX + layer.canvas().width()
       && y <= transY + layer.canvas().width());
 }
示例#3
0
  private void redraw() {
    layer.canvas().clear();
    if (bgImage != null) {
      layer.canvas().drawImage(bgImage, 0, 0, layer.canvas().width(), layer.canvas().height());
    }

    if (text != null) {
      layer.canvas().setFillColor(textColor);
      layer.canvas().drawText(text, textX, textY);
    }
    if (foreImage != null) {
      layer.canvas().drawImage(foreImage, 0, 0, layer.canvas().width(), layer.canvas().height());
    }
  }
示例#4
0
 public void setTranslation(int x, int y) {
   this.transX = x;
   this.transY = y;
   layer.setTranslation(x, y);
 }