Mods
Resource Packs
Data Packs
Modpacks
Shaders
Plugins
Mods Resource Packs Data Packs Plugins Shaders Modpacks
Get Modrinth App Upgrade to Modrinth+
Sign in
ModsPluginsData PacksShadersResource PacksModpacks
Sign in
Settings
Fabric Screen Layers

Fabric Screen Layers

Screen Layering Utility for Fabric

983
6
Library

Compatibility

Minecraft: Java Edition

1.20.4
1.20.2
1.20
1.19.2–1.19.4

Platforms

Fabric
Quilt

Supported environments

Client-side

90% of ad revenue goes to creators

Support creators and Modrinth ad-free with Modrinth+

Links

Report issues View source Join Discord server

Creators

mysticdrew
mysticdrew Owner

Details

Licensed MIT
Published 2 years ago
Updated last year
DescriptionChangelogVersions

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());

Modrinth is open source.

main@396f737

© Rinth, Inc.

Company

TermsPrivacyRulesCareers

Resources

SupportBlogDocsStatus

Interact

Discord X (Twitter) Mastodon Crowdin
Get Modrinth App Settings
NOT AN OFFICIAL MINECRAFT SERVICE. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.