Рендеринг в Gui

Версия Minecraft
1.19.2
API
Forge
36
1
1
Доброго времени суток, у меня такая проблема. как мне сделать прозрачные кнопки? они у меня в текстуре прозрачные а в gui нет, из за чего это может быть? вот код рендеринга кнопок, текста и бэкграунда:
Код:
//Background
@Override
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTicks){
//this.renderBackground(poseStack);
    super.render(poseStack, mouseX, mouseY, partialTicks);
 this.renderTooltip(poseStack, mouseX, mouseY);
}

//Down menu
@Override
protected void renderBg(PoseStack poseStack, float partialTicks, int gx, int gy) {
RenderSystem.setShaderColor(1,1,1,1);
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.setShaderTexture(0, new ResourceLocation("engine:textures/gui/menu.png"));
this.blit(poseStack, 0, 0, 0, 0, 1920, 1080, 1920, 1080);
RenderSystem.disableBlend();
}

//Buttons
Options options = Minecraft.getInstance().options;
Integer previousGuiScale = options.guiScale().get();
@Override
public void init() {
 super.init();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
this.minecraft.keyboardHandler.setSendRepeatsToGui(true);
this.button1 = new ImageButton(XButton1, YButton1, WidthButton1, HeightButton1, 0, 0, 0, new ResourceLocation("engine:textures/gui/button.png"), WidthButton1, HeightButton1, e -> {
if (true) {
engine.SIMPLE_CHANNEL.sendToServer(new DialogButtonMessage(0, x, y, z));
if (!list1.isEmpty()) {
Runnable runnable = list1.get(0);
 entity.closeContainer();
                runnable.run();
options.guiScale().set(previousGuiScale);
Minecraft.getInstance().resizeDisplay();
            }
        }
    });
guistate.put("buton1", button1);
this.addRenderableWidget(button1);
this.button2 = new ImageButton(XButton2, YButton2, WidthButton2, HeightButton2, 0, 0, 0, new ResourceLocation("engine:textures/gui/button.png"), WidthButton2, HeightButton2, e -> {
if (true) {
if (!list2.isEmpty()) {
Runnable runnable = list2.get(0);
 entity.closeContainer();
                runnable.run();
options.guiScale().set(previousGuiScale);
Minecraft.getInstance().resizeDisplay();
            }
        }
    });
guistate.put("buton2", button2);
this.addRenderableWidget(button2);
this.button3 = new ImageButton(XButton3, YButton3, WidthButton3, HeightButton3, 0, 0, 0, new ResourceLocation("engine:textures/gui/button.png"), WidthButton3, HeightButton3, e -> {
if (true) {
if (!list3.isEmpty()) {
Runnable runnable = list3.get(0);
 entity.closeContainer();
                runnable.run();
options.guiScale().set(previousGuiScale);
Minecraft.getInstance().resizeDisplay();
            }
        }
    });
guistate.put("buton3", button3);
this.addRenderableWidget(button3);
this.button4 = new ImageButton(XButton4, YButton4, WidthButton4, HeightButton4, 0, 0, 0, new ResourceLocation("engine:textures/gui/button.png"), WidthButton4, HeightButton4, e -> {
if (true) {
if (!list4.isEmpty()) {
Runnable runnable = list4.get(0);
 entity.closeContainer();
                runnable.run();
options.guiScale().set(previousGuiScale);
Minecraft.getInstance().resizeDisplay();
            }
        }
    });
guistate.put("buton4", button4);
this.addRenderableWidget(button4);
RenderSystem.disableBlend();
}

//Text
@Override
protected void renderLabels(PoseStack poseStack, int mouseX, int mouseY) {
float scale = 3f;
int color1 = 0xFF000000; //black
    poseStack.pushPose();
poseStack.scale(2, 2, 2);
this.font.draw(poseStack, Component.translatable(askname), -350, 260, color1);
this.font.draw(poseStack, Component.translatable(askname), -351, 259, -1);
poseStack.scale(1.5f, 1.5f, 1.5f);
this.font.draw(poseStack, Component.translatable(answer1name), YText1, XText1, color1);
this.font.draw(poseStack, Component.translatable(answer1name), YText1+1, XText1+1, -1);
this.font.draw(poseStack, Component.translatable(answer2name), YText2, XText2, color1);
this.font.draw(poseStack, Component.translatable(answer2name), YText2+1, XText2+1, -1);
this.font.draw(poseStack, Component.translatable(answer3name), YText3, XText3, color1);
this.font.draw(poseStack, Component.translatable(answer3name), YText3+1, XText3+1, -1);
this.font.draw(poseStack, Component.translatable(answer4name), YText4, XText4, color1);
this.font.draw(poseStack, Component.translatable(answer4name), YText4+1, XText4+1, -1);
}
    }
 
Последнее редактирование:
Сверху