2014-04-29 10:54:20 +10:00
|
|
|
package codechicken.nei;
|
|
|
|
|
|
|
|
|
|
import static codechicken.lib.gui.GuiDraw.drawString;
|
|
|
|
|
import static codechicken.lib.gui.GuiDraw.drawStringC;
|
|
|
|
|
|
2022-06-24 12:32:13 +01:00
|
|
|
public class Label extends Widget {
|
2023-01-28 17:55:51 -08:00
|
|
|
|
2019-12-30 20:19:16 -08:00
|
|
|
final boolean centered;
|
|
|
|
|
final int colour;
|
2019-12-24 13:37:41 -08:00
|
|
|
public String text;
|
2022-06-24 12:32:13 +01:00
|
|
|
|
|
|
|
|
public Label(String s, boolean center, int color) {
|
2014-04-29 10:54:20 +10:00
|
|
|
text = s;
|
|
|
|
|
centered = center;
|
|
|
|
|
colour = color;
|
|
|
|
|
}
|
2022-06-24 12:32:13 +01:00
|
|
|
|
|
|
|
|
public Label(String s, boolean center) {
|
2014-04-29 10:54:20 +10:00
|
|
|
this(s, center, 0xFFFFFFFF);
|
|
|
|
|
}
|
2022-06-24 12:32:13 +01:00
|
|
|
|
2014-04-29 10:54:20 +10:00
|
|
|
@Override
|
2022-06-24 12:32:13 +01:00
|
|
|
public void draw(int mousex, int mousey) {
|
|
|
|
|
if (centered) drawStringC(text, x, y, colour);
|
|
|
|
|
else drawString(text, x, y, colour);
|
2014-04-29 10:54:20 +10:00
|
|
|
}
|
|
|
|
|
}
|