Начинающий
- Статус
- Оффлайн
- Регистрация
- 1 Окт 2022
- Сообщения
- 177
- Реакции
- 5
Java:
public class GuiMainMenu extends GuiScreen {
private final long initTime = System.currentTimeMillis();
public float scale = 2;
public GuiMainMenu() {
}
private int width;
// public float scale = 2.0;
private animbackground backgroundShader;
// private final long initTime = System.currentTimeMillis();
private int height;
private Animation initAnimation;
public void initGui() {
ScaledResolution sr = new ScaledResolution(this.mc);
this.width = sr.getScaledWidth();
this.height = sr.getScaledHeight();
this.initAnimation = new Animation(300, 1.0) {
@Override
protected double getEquation(double x) {
return 0;
}
};
this.buttonList.add(new GuiMainMenuButton(0, this.width / 2 - 90, this.height / 2 + 4, 180, 10, "Singleplayer"));
}
public void drawScreen(int mouseX, int mouseY, float partialTicks) throws InterruptedException {
ScaledResolution sr = new ScaledResolution(this.mc);
try {
this.backgroundShader = new animbackground("/noise.fsh");
} catch (IOException var9) {
throw new IllegalStateException("Failed to load backgound shader", var9);
}
Gui.drawRect(0.0, 0.0, 0.0, 1500.0, (new Color(16777215)).getRGB());
this.backgroundShader.useShader(this.width, this.height, (float)sr.getScaledWidth(), (float)sr.getScaledHeight(), (float)(System.currentTimeMillis() - this.initTime) / 1000.0F);
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex2f(-1.0F, -1.0F);
GL11.glVertex2f(-1.0F, 1.0F);
GL11.glVertex2f(1.0F, 1.0F);
GL11.glVertex2f(1.0F, -1.0F);
GL11.glEnd();
GlStateManager.disableCull();
GL20.glUseProgram(0);
this.mc.mntsb_15.drawStringWithShadow(ChatFormatting.WHITE + "STILIST1CK DAYN" + ChatFormatting.WHITE + ChatFormatting.WHITE + KeazClient.instance.version, 430, 300, -1);
super.drawScreen(mouseX, mouseY, partialTicks);
}