diff --git a/src/main/java/aeronicamc/mods/mxtune/render/OverlayItemGui.java b/src/main/java/aeronicamc/mods/mxtune/render/OverlayItemGui.java index a264eddd..e7503131 100644 --- a/src/main/java/aeronicamc/mods/mxtune/render/OverlayItemGui.java +++ b/src/main/java/aeronicamc/mods/mxtune/render/OverlayItemGui.java @@ -138,11 +138,10 @@ public boolean render(int x, int y, int instIndex, MatrixStack pPoseStack) { switch (position) { case LEFT: - xPos = 0F - this.overlayItem.totalWidth() + ((float)this.overlayItem.totalWidth() * this.getVisibility(ms)); + xPos = this.overlayItem.totalWidth() * (1 - this.getVisibility(ms)) + this.overlayItem.totalWidth() * (this.getVisibility(ms)) - this.overlayItem.totalWidth(); break; case CENTER: - xPos = (x * 0.5F) - this.overlayItem.totalWidth() * 0.5F; - yPos = 0F - this.overlayItem.totalHeight() + (y * ratio + this.overlayItem.totalHeight() * ratio) * this.getVisibility(ms); + xPos = ((x * this.getVisibility(ms) * 0.5F)) + ((x * (1F - this.getVisibility(ms)) * 0.5F)) - this.overlayItem.totalWidth() * 0.5F * (this.getVisibility(ms)); break; case RIGHT: xPos = (float)x - (float)this.overlayItem.totalWidth() * this.getVisibility(ms); @@ -152,7 +151,10 @@ public boolean render(int x, int y, int instIndex, MatrixStack pPoseStack) { } RenderSystem.pushMatrix(); + RenderSystem.translatef(xPos, yPos, 800F + instIndex); + RenderSystem.scalef(this.getVisibility(ms), this.getVisibility(ms), 1F); + IOverlayItem.Visibility overlayVisibility = this.overlayItem.render(pPoseStack, OverlayItemGui.this, ms - this.visibleTime); RenderSystem.popMatrix(); if (overlayVisibility != this.visibility) {