- 211
- 14
- 37
Всем привет, сделал гуи сделал кнопки и хочу чтобы при нажатии на кнопку происходило действие if (button.id == 1) но не знаю как указать путь до класса и сделать чтобы этот класс рендерил текст или картинку.
Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
Дак оно у меня естьПосмотри actionPerformed метод.
protected void actionPerformed(GuiButton button) {
if (button.enabled) {
if (button.id == 1) {
}
if (button.id == 2) {
}
}
}
protected void actionPerformed(GuiButton par1GuiButton) {
switch (par1GuiButton.id) {
case 0:
this.mc.displayGuiScreen(new Твой_класс_с_гуи());
break;
}
}
Мне надо не гуи а чтобы если кнопка была нажата то рендерилось что-то из другого класса класса.protected void actionPerformed(GuiButton par1GuiButton) { switch (par1GuiButton.id) { case 0: this.mc.displayGuiScreen(new Твой_класс_с_гуи()); break; } }
if (button.id == 1) {
}