aboutsummaryrefslogtreecommitdiff
path: root/src/gameplay/TButton.java
blob: 6af12095a21224bd014344f5accf30c18fb74841 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//glowing block of color c (jfx node)

package gameplay;

import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;

public class TButton extends Rectangle
{
    private Color col;
    private Color fill;
    public TButton(Color c, double a, double b, int r)
    {
        super();
        
        col = c;
        fill = new Color(c.darker().getRed(), c.darker().getGreen(), c.darker().getBlue(), 0.45);
        super.setFill(fill);
        super.setWidth(a);
        super.setHeight(b);
        super.setArcHeight(r);
        super.setArcWidth(r);
        super.setStroke(col);
        super.setStrokeWidth(5);
    }

    public void setColor(Color c) {
        col = c;
        fill = new Color(c.darker().getRed(), c.darker().getGreen(), c.darker().getBlue(), 0.45);
        super.setFill(fill);
        super.setStroke(c);
    }

    public Color getFillColor() {
        return fill;
    }

    public Color getColor() {
        return col;
    }
}