- Joined
- Jul 11, 2020
- Messages
- 0
- Reaction score
- 26
- Points
- 0
Ich hatte schon einmal gefragt wie man den Background wechseln kann. Das habe ich alles hin bekommen aber immer wen der int sich um 1 herhöht wird ja ein neuer Background gedrawt. Aber um den ersteinmal zu drawn muss man den alten Background löschen und so kann man nur bis 2 Backgrounds bei mir und dann wird der Background weiß. Weiß jmd. wie man es machen kann ohne die Texture zu deleten?
Codes:
GuiMainMenu.java:
WallpaperUtil:
Danke
Codes:
GuiMainMenu.java:
Code:
actionPerformed:
if(button.id == 992) {
if(bgID == 0) {
BGid++;
} else if (bgID == 1) {
WallpaperUtils.ZWEI();
bgID++;
} else if (bgID == 2) {
WallpaperUtils.Standard();
bgID = 0;
}
}
drawScreen:
GlStateManager.disableAlpha();
ScaledResolution sr = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
WallpaperUtils.Standard();
Gui.drawModalRectWithCustomSizedTexture(0, 0, 0, 0, sr.getScaledWidth(), sr.getScaledHeight(), sr.getScaledWidth(), sr.getScaledHeight());
WallpaperUtil:
Code:
public static String WallpaperBG = "1";
private static Minecraft mc = Minecraft.getMinecraft();
public static void Standard() {
mc.getTextureManager().bindTexture(new ResourceLocation("Pulchra/1.png"));
Gui.drawModalRectWithCustomSizedTexture(0,0,0,0,0,0,0,0);
}
public static void ZWEI() {
mc.getTextureManager().deleteTexture(new ResourceLocation("Pulchra/1.png"));
mc.getTextureManager().bindTexture(new ResourceLocation("Pulchra/2.png"));
Gui.drawModalRectWithCustomSizedTexture(0,0,0,0,0,0,0,0);
}
Danke