FabricScreenLayers is modelled after Minecraft Forge's GuiScreenLayering logic using mixins. Provides utility to layer minecraft gui screens on top of one another.
Examples Usages:
To add a screen on top of another screen:
ScreenLayerManager.pushLayer(new CustomScreen());
To remove a screen:
ScreenLayerManager.popLayer();
To clear all screens:
ScreenLayerManager.clearLayers();
When translating a screen or item on the screen for sizing.
It is important to use ScreenLayerManager.getFarPlane()
so it does not break mods using layers.
RenderSystem.clear(GL_DEPTH_BUFFER_BIT, Minecraft.ON_OSX);
Matrix4f matrix4f = new Matrix4f().setOrtho(0.0F, (float) width, (float) height, 0.0F, 100.0F, ScreenLayerManager.getFarPlane());
RenderSystem.setProjectionMatrix(matrix4f);
PoseStack posestack = RenderSystem.getModelViewStack();
posestack.setIdentity();
posestack.translate(0.0D, 0.0D, 1000.0F - ScreenLayerManager.getFarPlane());
90% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Compatibility
Minecraft: Java Edition
1.20.4
1.20.2
1.20
1.19.2–1.19.4
Platforms
Fabric
Supported environments
Creators
Details
Licensed MIT
Published last year
Updated 11 months ago