24 lines
673 B
Java
24 lines
673 B
Java
![]() |
package game.gui.element;
|
||
|
|
||
|
import game.renderer.Drawing;
|
||
|
|
||
|
public class SelectableButton extends ActButton {
|
||
|
private boolean selected;
|
||
|
|
||
|
public SelectableButton(int x, int y, int w, int h, Callback callback, String text, boolean selected) {
|
||
|
super(x, y, w, h, callback, text);
|
||
|
this.selected = selected;
|
||
|
}
|
||
|
|
||
|
protected void drawBackground() {
|
||
|
if(this.selected)
|
||
|
Drawing.drawGradientBorder(this.pos_x, this.pos_y, this.size_x, this.size_y, this.gm.style.fill_btm, this.gm.style.fill_top, 0xff000000, this.gm.style.brdr_top, this.gm.style.brdr_btm);
|
||
|
else
|
||
|
super.drawBackground();
|
||
|
}
|
||
|
|
||
|
public void setSelected(boolean selected) {
|
||
|
this.selected = selected;
|
||
|
}
|
||
|
}
|