X-Git-Url: https://deadsoftware.ru/gitweb?p=cavedroid.git;a=blobdiff_plain;f=core%2Fsrc%2Fru%2Fdeadsoftware%2Fcavecraft%2Fmenu%2Fobjects%2FButton.java;h=b6810a704547ddda85a72200e8559a94473b0c04;hp=a2835fc90899a41d000c93a772ab5156e4961668;hb=792296717939ac50df33865ae3acbb010e812ad1;hpb=9837004539187e09f955d347dd6b3d838d9fefb1 diff --git a/core/src/ru/deadsoftware/cavecraft/menu/objects/Button.java b/core/src/ru/deadsoftware/cavecraft/menu/objects/Button.java index a2835fc..b6810a7 100644 --- a/core/src/ru/deadsoftware/cavecraft/menu/objects/Button.java +++ b/core/src/ru/deadsoftware/cavecraft/menu/objects/Button.java @@ -1,4 +1,57 @@ 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) { + 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; + } + }