Class ScreenUtils

java.lang.Object
net.minecraftforge.client.gui.ScreenUtils

public class ScreenUtils extends Object
This class provides several methods and constants used by the Config GUI classes.
Author:
bspkrs
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final String
     
    static final String
     
    static int[]
     
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    blitInscribed(PoseStack poseStack, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight)
     
    static void
    blitInscribed(PoseStack poseStack, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight, boolean centerX, boolean centerY)
     
    static void
    blitWithBorder(PoseStack poseStack, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int borderSize, float zLevel)
    Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders and filler.
    static void
    blitWithBorder(PoseStack poseStack, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel)
    Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders and filler.
    static void
    blitWithBorder(PoseStack poseStack, ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int borderSize, float zLevel)
    Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders and filler.
    static void
    blitWithBorder(PoseStack poseStack, ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel)
    Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders and filler.
    static void
    drawGradientRect(org.joml.Matrix4f mat, int zLevel, int left, int top, int right, int bottom, int startColor, int endColor)
     
    static void
    drawTexturedModalRect(PoseStack poseStack, int x, int y, int u, int v, int width, int height, float zLevel)
     
    static int
    getColorFromFormattingCharacter(char c, boolean isLighter)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ScreenUtils

      public ScreenUtils()
  • Method Details

    • getColorFromFormattingCharacter

      public static int getColorFromFormattingCharacter(char c, boolean isLighter)
    • blitWithBorder

      public static void blitWithBorder(PoseStack poseStack, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int borderSize, float zLevel)
      Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders and filler. It is assumed that the desired texture ResourceLocation object has been bound using Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation).
      Parameters:
      poseStack - the gui pose stack
      x - x axis offset
      y - y axis offset
      u - bound resource location image x offset
      v - bound resource location image y offset
      width - the desired box width
      height - the desired box height
      textureWidth - the width of the box texture in the resource location image
      textureHeight - the height of the box texture in the resource location image
      borderSize - the size of the box's borders
      zLevel - the zLevel to draw at
    • blitWithBorder

      public static void blitWithBorder(PoseStack poseStack, ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int borderSize, float zLevel)
      Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders and filler. The provided ResourceLocation object will be bound using Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation).
      Parameters:
      poseStack - the gui pose stack
      res - the ResourceLocation object that contains the desired image
      x - x axis offset
      y - y axis offset
      u - bound resource location image x offset
      v - bound resource location image y offset
      width - the desired box width
      height - the desired box height
      textureWidth - the width of the box texture in the resource location image
      textureHeight - the height of the box texture in the resource location image
      borderSize - the size of the box's borders
      zLevel - the zLevel to draw at
    • blitWithBorder

      public static void blitWithBorder(PoseStack poseStack, ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel)
      Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders and filler. The provided ResourceLocation object will be bound using Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation).
      Parameters:
      poseStack - the gui pose stack
      res - the ResourceLocation object that contains the desired image
      x - x axis offset
      y - y axis offset
      u - bound resource location image x offset
      v - bound resource location image y offset
      width - the desired box width
      height - the desired box height
      textureWidth - the width of the box texture in the resource location image
      textureHeight - the height of the box texture in the resource location image
      topBorder - the size of the box's top border
      bottomBorder - the size of the box's bottom border
      leftBorder - the size of the box's left border
      rightBorder - the size of the box's right border
      zLevel - the zLevel to draw at
    • blitWithBorder

      public static void blitWithBorder(PoseStack poseStack, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel)
      Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders and filler. It is assumed that the desired texture ResourceLocation object has been bound using Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation).
      Parameters:
      poseStack - the gui pose stack
      x - x axis offset
      y - y axis offset
      u - bound resource location image x offset
      v - bound resource location image y offset
      width - the desired box width
      height - the desired box height
      textureWidth - the width of the box texture in the resource location image
      textureHeight - the height of the box texture in the resource location image
      topBorder - the size of the box's top border
      bottomBorder - the size of the box's bottom border
      leftBorder - the size of the box's left border
      rightBorder - the size of the box's right border
      zLevel - the zLevel to draw at
    • drawTexturedModalRect

      public static void drawTexturedModalRect(PoseStack poseStack, int x, int y, int u, int v, int width, int height, float zLevel)
    • drawGradientRect

      public static void drawGradientRect(org.joml.Matrix4f mat, int zLevel, int left, int top, int right, int bottom, int startColor, int endColor)
    • blitInscribed

      public static void blitInscribed(PoseStack poseStack, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight)
    • blitInscribed

      public static void blitInscribed(PoseStack poseStack, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight, boolean centerX, boolean centerY)