Hi, I am on an issue currently, I am rendering the screen gui as well as the tooltips. However they do not align.
Moreover, even when I align them on screen and then try to open the screen on my other monitor which has a different resolution, it removes every alignment.
Here is the Menu constructor, with the slots positions :
public RingInfuserMenu(int windowId, Inventory inv, BlockEntity be, ContainerData data) {
super(AlcaMenuTypes.RING_INFUSER_MENU.get(), windowId);
checkContainerSize(inv, 4);
this.be = (RingInfuserBlockEntity) be;
this.level = inv.player.level;
this.data = data;
// Forge Inv
this.be.getCapability(ForgeCapabilities.ITEM_HANDLER).ifPresent(handler -> {
this.addSlot(new RingInfuserRingSlot(handler, 0, 20, 31));
this.addSlot(new RingInfuserInfuserSlot(handler, 1, 65, 75));
this.addSlot(new GenericFuelSlot(handler, 2, 95, 75));
this.addSlot(new GenericOutput(handler, 3, 140, 31));
});
addDataSlots(data);
// Player Inv
for (int row = 0 ; row < 3 ; row++) {
for (int col = 0 ; col < 9 ; col++) {
this.addSlot(new Slot(inv, col + row * 9 + 9, 8 + col * 18, 84 + (row * 18)));
}
}
// Player HotBar
for (int col = 0 ; col < 9 ; col++) {
this.addSlot(new Slot(inv, col, 8 + col * 18, 142));
}
}
And the Screen RenderBg method :
@Override protected void renderBg(PoseStack poseStack, float pTick, int pMouseX, int pMouseY) {
RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
RenderSystem.setShaderTexture(0, INFUSER_GUI);
this.imageWidth = 176;
this.imageHeight = 201;
int x = (width - imageWidth) / 2;
int y = (height - imageHeight) / 2;
this.blit(poseStack, x, y, 0, 0, imageWidth, imageHeight);
this.blit(poseStack, x + 38, y + 24, 0, 201, this.menu.getInfuseProgressionScaled(), 35);
this.blit(poseStack, x + 85, y + 73 - this.menu.getHeatProgressionScaled(), 100, 211 - this.menu.getHeatProgressionScaled(), 21, this.menu.getHeatProgressionScaled());
GlStateManager._enableBlend();
GlStateManager._blendFunc(GlStateManager.SourceFactor.SRC_ALPHA.value, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA.value);
this.blit(poseStack, x + 79, y + 61 - this.menu.getEssenceLevel(), 121 + this.menu.getEssenceOffset(), 246 - this.menu.getEssenceLevel(), 18, this.menu.getEssenceLevel());
GlStateManager._disableBlend();
}
Thanks for your help