X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=core%2Fsrc%2Fru%2Fdeadsoftware%2Fcavecraft%2Fmenu%2Fobjects%2FButton.java;h=d08370ef8506b3fa0b8d369dca58b0c83a5b5b45;hb=6ab2a53526f16de139d39a59c3d800e5f3013c68;hp=a2835fc90899a41d000c93a772ab5156e4961668;hpb=9837004539187e09f955d347dd6b3d838d9fefb1;p=cavedroid.git diff --git a/core/src/ru/deadsoftware/cavecraft/menu/objects/Button.java b/core/src/ru/deadsoftware/cavecraft/menu/objects/Button.java index a2835fc..d08370e 100644 --- a/core/src/ru/deadsoftware/cavecraft/menu/objects/Button.java +++ b/core/src/ru/deadsoftware/cavecraft/menu/objects/Button.java @@ -1,4 +1,61 @@ package ru.deadsoftware.cavecraft.menu.objects; +import com.badlogic.gdx.math.Rectangle; + public class Button { + + private Rectangle rect; + private String label; + private int type; + + public Button(String label, float x, float y, float width, float heigth, int type) { + this.label = label; + rect = new Rectangle(x, y, width, heigth); + this.type = type; + } + + public Button(String label, float x, float y, float width, float heigth) { + this(label, x, y, width, heigth, 1); + } + + public Button(String label, float x, float y, int type) { + this(label, x, y, 200, 20, type); + } + + public Button(String label, float x, float y) { + this(label, x, y, 200, 20, 1); + } + + public Rectangle getRect() { + return rect; + } + + public String getLabel() { + return label; + } + + public float getX() { + return rect.x; + } + + public float getY() { + return rect.y; + } + + public float getWidth() { + return rect.width; + } + + public float getHeight() { + return rect.height; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + }