public void setVisible(boolean visible) { this.visible = visible; if (visible) { redraw(); } else { layer.canvas().clear(); } }
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()); }
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()); } }
public void setTranslation(int x, int y) { this.transX = x; this.transY = y; layer.setTranslation(x, y); }