diff options
| author | Unknown <shekwancheung0528@gmail.com> | 2019-02-16 16:11:20 +0800 |
|---|---|---|
| committer | Unknown <shekwancheung0528@gmail.com> | 2019-02-16 16:11:20 +0800 |
| commit | e033e8f807e7d5bb0c9b950a9550944c34612660 (patch) | |
| tree | 5bf3d78dfb0bbc06fbede6f2c91cd5c92cca7c26 /src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java | |
| parent | 1e9a3866c00c7750247593de047f3a37c7db5fd7 (diff) | |
| download | RoughlyEnoughItems-e033e8f807e7d5bb0c9b950a9550944c34612660.tar.gz RoughlyEnoughItems-e033e8f807e7d5bb0c9b950a9550944c34612660.tar.bz2 RoughlyEnoughItems-e033e8f807e7d5bb0c9b950a9550944c34612660.zip | |
RIght to Left supported languages
Diffstat (limited to 'src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java index eb6584798..62eda708d 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java @@ -6,6 +6,7 @@ import net.minecraft.client.audio.PositionedSoundInstance; import net.minecraft.client.font.FontRenderer; import net.minecraft.client.gui.Drawable; import net.minecraft.sound.SoundEvents; +import net.minecraft.text.TextComponent; import net.minecraft.util.Identifier; import net.minecraft.util.math.MathHelper; @@ -23,6 +24,10 @@ public abstract class ButtonWidget extends Drawable implements IWidget { private boolean pressed; private Rectangle bounds; + public ButtonWidget(Rectangle rectangle, TextComponent text) { + this(rectangle, text.getFormattedText()); + } + public ButtonWidget(Rectangle rectangle, String text) { this.bounds = rectangle; this.enabled = true; @@ -34,6 +39,10 @@ public abstract class ButtonWidget extends Drawable implements IWidget { this(new Rectangle(x, y, width, height), text); } + public ButtonWidget(int x, int y, int width, int height, TextComponent text) { + this(new Rectangle(x, y, width, height), text); + } + public Rectangle getBounds() { return bounds; } |
