Interface ForegroundRender

All Known Implementing Classes:
GuiText, GuiTextList

public interface ForegroundRender
Allows a Gui Elements to render content in front of child elements. Note: Most elements should use BackgroundRender to render their content.

Created by brandon3055 on 07/08/2023

  • Method Summary

    Modifier and Type
    Method
    Description
    default double
    Specifies the z depth of the foreground content.
    void
    renderForeground(GuiRender render, double mouseX, double mouseY, float partialTicks)
    Used to render content in front of this elements child elements.
  • Method Details

    • getForegroundDepth

      default double getForegroundDepth()
      Specifies the z depth of the foreground content. Used when calculating the total depth of this gui element. 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.
    • renderForeground

      void renderForeground(GuiRender render, double mouseX, double mouseY, float partialTicks)
      Used to render content in front of this elements child elements. When rendering element content, always use the PoseStack available via the provided GuiRender Where 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.