Package codechicken.lib.gui.modular.lib
Interface BackgroundRender
- All Known Implementing Classes:
GuiColourPicker.ColourPreview,GuiColourPicker.SliderBG,GuiEnergyBar,GuiEntityRenderer,GuiFluidTank,GuiItemStack,GuiProgressIcon,GuiRectangle,GuiSlots,GuiTextField,GuiTexture
public interface BackgroundRender
Allows a Gui Elements to render content behind child elements.
This is the default render mode for the majority of elements.
Created by brandon3055 on 07/08/2023
-
Method Summary
Modifier and TypeMethodDescriptiondefault doubleSpecifies the z depth of the background content.voidrenderBackground(GuiRender render, double mouseX, double mouseY, float partialTicks) Used to render content behind this elements child elements.
-
Method Details
-
getBackgroundDepth
default double getBackgroundDepth()Specifies the z depth of the background content. AfterrenderBackground(GuiRender, double, double, float)is called, the PoseStack will be translated by this amount in the z direction before any assigned child elements are rendered. Recommended minimum depth is 0.01 or 0.035 if this element renders text. (text shadows are rendered with a 0.03 offset)- Returns:
- the z height of the background content.
-
renderBackground
Used to render content behind this elements child elements. When rendering element content, always use thePoseStackavailable via the providedGuiRenderWhere applicable, always use push/pop to ensure the stack is returned to its original state after your rendering is complete.- Parameters:
render- Contains gui context information as well as essential render methods/utils including the PoseStack.
-