From cd0cd844fbe1b4812ba211567276ca3074d32f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 10 Nov 2015 11:32:41 +0100 Subject: Patch: add setBtnLeft(Bg) and setBtnRight(Bg) --- core/src/ch/asynk/rustanddust/ui/Patch.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/src/ch/asynk/rustanddust/ui/Patch.java b/core/src/ch/asynk/rustanddust/ui/Patch.java index acff791..f07c44d 100644 --- a/core/src/ch/asynk/rustanddust/ui/Patch.java +++ b/core/src/ch/asynk/rustanddust/ui/Patch.java @@ -25,4 +25,14 @@ public class Patch extends Widget if (!visible) return; patch.draw(batch, rect.x, rect.y, rect.width, rect.height); } + + public void setBtnRight(Bg btn) + { + btn.setPosition((rect.x + rect.width - (btn.getWidth() * 0.666f)), (rect.y - (btn.getHeight() * 0.333f))); + } + + public void setBtnLeft(Bg btn) + { + btn.setPosition((rect.x - (btn.getWidth() * 0.333f)), (rect.y - (btn.getHeight() * 0.333f))); + } } -- cgit v1.1-2-g2b99