DEADSOFTWARE

One GameProc object for everything
[cavedroid.git] / core / src / ru / deadsoftware / cavedroid / menu / objects / Button.java
1 package ru.deadsoftware.cavedroid.menu.objects;
3 import com.badlogic.gdx.math.Rectangle;
5 public class Button {
7 private Rectangle rect;
8 private String label;
9 private int type;
11 public Button(String label, float x, float y, float width, float heigth, int type) {
12 this.label = label;
13 rect = new Rectangle(x, y, width, heigth);
14 this.type = type;
15 }
17 public Button(String label, float x, float y, float width, float heigth) {
18 this(label, x, y, width, heigth, 1);
19 }
21 public Button(String label, float x, float y, int type) {
22 this(label, x, y, 200, 20, type);
23 }
25 public Button(String label, float x, float y) {
26 this(label, x, y, 200, 20, 1);
27 }
29 public Rectangle getRect() {
30 return rect;
31 }
33 public String getLabel() {
34 return label;
35 }
37 public float getX() {
38 return rect.x;
39 }
41 public float getY() {
42 return rect.y;
43 }
45 public float getWidth() {
46 return rect.width;
47 }
49 public float getHeight() {
50 return rect.height;
51 }
53 public int getType() {
54 return type;
55 }
57 public void setType(int type) {
58 this.type = type;
59 }
61 }