Class ScreenBuilder
java.lang.Object
net.dillon.dillonlib.screen.ScreenBuilder
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionintCaptures the graphics height in its current place.intCaptures the graphics width in its current place.intCaptures the height in its current place.intCaptures the width in its current place.intintgraphicsHeight(net.minecraft.client.gui.components.AbstractWidget widget) Calculates the graphics height at the bottom center, and returns the new value.Calculates the graphics height at the center, and returns the new value.Calculates the current graphics height moved down bydefaultGraphicsOffset(), and returns the new value.graphicsHeightDown(int amount) Calculates the current graphics height moved down, and returns the new value.Calculates the graphics height at the top center, and returns the new value.Calculates the current graphics height moved up bydefaultOffset(), and returns the new value.graphicsHeightUp(int amount) Calculates the current graphics height moved up, and returns the new value.graphicsWidth(net.minecraft.client.gui.components.AbstractWidget widget) Calculates the graphics width at the center, and returns the new value.Calculates the current graphics width moved left bydefaultGraphicsOffset(), and returns the new value.graphicsWidthLeft(int amount) Calculates the current graphics width moved left, and returns the new value.Calculates the current graphics width moved right bydefaultGraphicsOffset(), and returns the new value.graphicsWidthRight(int amount) Calculates the current graphics width moved right, and returns the new value.Calculates the graphics width at the bottom left, and returns the new value.Calculates the graphics width at the bottom right, and returns the new value.height(net.dillon.dillonlib.screen.ScreenBuilder.ScreenPos pos, net.dillon.dillonlib.screen.ScreenBuilder.Type type) Calculates the height at a specific screen position, and returns the new value.height(net.minecraft.client.gui.components.AbstractWidget widget) Calculates the height at the bottom center, and returns the new value.Calculates the height at the center, and returns the new value.Calculates the current height moved down bydefaultOffset(), and returns the new value.heightDown(int amount) Calculates the current height moved down, and returns the new value.Calculates the height at the top center, and returns the new value.heightUp()Calculates the current height moved up bydefaultOffset(), and returns the new value.heightUp(int amount) Calculates the current height moved up, and returns the new value.multiLineTextCenterAndHeightDown(net.minecraft.network.chat.Component text) Adds a centered multi-line text widget and then moves the height down.multiLineTextCenterAndHeightDown(net.minecraft.network.chat.Component text, int maxWidth) Adds a centered multi-line text widget with a custom max width and then moves the height down.multiLineTextCenterAndHeightDown(net.minecraft.network.chat.Component text, int maxWidth, int amount) Adds a centered multi-line text widget with a custom max width and height offset.static ScreenBuilderof(net.minecraft.client.gui.screens.Screen screen) Creates a newScreenBuilder.static ScreenBuilderofBottomCentered(net.minecraft.client.gui.screens.Screen screen) static ScreenBuilderofBottomLeft(net.minecraft.client.gui.screens.Screen screen) static ScreenBuilderofBottomRight(net.minecraft.client.gui.screens.Screen screen) static ScreenBuilderofCentered(net.minecraft.client.gui.screens.Screen screen) static ScreenBuilderofTopCentered(net.minecraft.client.gui.screens.Screen screen) static ScreenBuilderofTopLeft(net.minecraft.client.gui.screens.Screen screen) static ScreenBuilderofTopRight(net.minecraft.client.gui.screens.Screen screen) voidResets the width and height to the initial values.voidResets the render bounds to the initial values.textCenterAndGraphicsHeightDown(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.network.chat.Component text) Draws text and then moves the height down.textCenterAndGraphicsHeightDown(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.network.chat.Component text, int amount) Draws text and then moves the height down by a specific amount.textCenterAndGraphicsHeightDownWrapped(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.network.chat.Component text) Draws wrapped text centered and moves the height down after each line.textCenterAndGraphicsHeightDownWrapped(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.network.chat.Component text, int maxWidth) Draws wrapped text centered and moves the height down after each line, with a custom max width.textCenterAndGraphicsHeightDownWrapped(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.network.chat.Component text, int maxWidth, int amount) Draws wrapped text centered and moves the height down by a specific amount after each line, with a custom max width and amount for each line.textCenterGraphicsHeight(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.network.chat.Component text) Draws text in a centered fashion.textCenterGraphicsHeight(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.network.chat.Component text, int height) Draws text in a centered fashion at a specific height.textTitleGraphicsHeight(net.minecraft.client.gui.GuiGraphicsExtractor graphics) Draws title text on a screen.textTitleGraphicsHeight(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.network.chat.Component title) Draws custom title text on a screen.width(net.dillon.dillonlib.screen.ScreenBuilder.ScreenPos pos, net.dillon.dillonlib.screen.ScreenBuilder.Type type) width(net.minecraft.client.gui.components.AbstractWidget widget) Calculates the width at the bottom left, and returns the new value.Calculates the width at the bottom right, and returns the new value.Calculates the width at the center, and returns the new value.Calculates the current width moved left bydefaultOffset(), and returns the new value.widthLeft(int amount) Calculates the current width moved left, and returns the new value.Calculates the current width moved right bydefaultOffset(), and returns the new value.widthRight(int amount) Calculates the current width moved right, and returns the new value.
-
Method Details
-
of
Creates a newScreenBuilder.- Parameters:
screen- the screen to build on.- Returns:
- a new screen builder.
-
ofBottomCentered
- Returns:
- a bottom-centered screen builder.
-
ofCentered
- Returns:
- a centered screen builder.
-
ofTopCentered
- Returns:
- a top-centered screen builder.
-
ofBottomLeft
- Returns:
- a bottom-left screen builder.
-
ofBottomRight
- Returns:
- a bottom-right screen builder.
-
ofTopLeft
- Returns:
- a top-left screen builder.
-
ofTopRight
- Returns:
- a top-right screen builder.
-
captureWidth
public int captureWidth()Captures the width in its current place. -
captureHeight
public int captureHeight()Captures the height in its current place. -
captureGraphicsWidth
public int captureGraphicsWidth()Captures the graphics width in its current place. -
captureGraphicsHeight
public int captureGraphicsHeight()Captures the graphics height in its current place. -
defaultOffset
public int defaultOffset()- Returns:
- the default offset for modifying width and height.
-
defaultGraphicsOffset
public int defaultGraphicsOffset()- Returns:
- the default render offset for modifying graphics width and graphics height.
-
resetBounds
public void resetBounds()Resets the width and height to the initial values. -
resetRenderBounds
public void resetRenderBounds()Resets the render bounds to the initial values. -
textTitleGraphicsHeight
public ScreenBuilder.ScreenValue textTitleGraphicsHeight(net.minecraft.client.gui.GuiGraphicsExtractor graphics) Draws title text on a screen. -
textTitleGraphicsHeight
public ScreenBuilder.ScreenValue textTitleGraphicsHeight(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.network.chat.Component title) Draws custom title text on a screen. -
textCenterAndGraphicsHeightDown
public ScreenBuilder.ScreenValue textCenterAndGraphicsHeightDown(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.network.chat.Component text) Draws text and then moves the height down. -
textCenterAndGraphicsHeightDown
public ScreenBuilder.ScreenValue textCenterAndGraphicsHeightDown(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.network.chat.Component text, int amount) Draws text and then moves the height down by a specific amount. -
textCenterGraphicsHeight
public ScreenBuilder.ScreenValue textCenterGraphicsHeight(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.network.chat.Component text) Draws text in a centered fashion. -
textCenterGraphicsHeight
public ScreenBuilder.ScreenValue textCenterGraphicsHeight(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.network.chat.Component text, int height) Draws text in a centered fashion at a specific height. -
textCenterAndGraphicsHeightDownWrapped
public ScreenBuilder.ScreenValue textCenterAndGraphicsHeightDownWrapped(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.network.chat.Component text) Draws wrapped text centered and moves the height down after each line. -
textCenterAndGraphicsHeightDownWrapped
public ScreenBuilder.ScreenValue textCenterAndGraphicsHeightDownWrapped(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.network.chat.Component text, int maxWidth) Draws wrapped text centered and moves the height down after each line, with a custom max width. -
textCenterAndGraphicsHeightDownWrapped
public ScreenBuilder.ScreenValue textCenterAndGraphicsHeightDownWrapped(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.network.chat.Component text, int maxWidth, int amount) Draws wrapped text centered and moves the height down by a specific amount after each line, with a custom max width and amount for each line. -
multiLineTextCenterAndHeightDown
public ScreenBuilder.ScreenValue multiLineTextCenterAndHeightDown(net.minecraft.network.chat.Component text) Adds a centered multi-line text widget and then moves the height down. -
multiLineTextCenterAndHeightDown
public ScreenBuilder.ScreenValue multiLineTextCenterAndHeightDown(net.minecraft.network.chat.Component text, int maxWidth) Adds a centered multi-line text widget with a custom max width and then moves the height down. -
multiLineTextCenterAndHeightDown
public ScreenBuilder.ScreenValue multiLineTextCenterAndHeightDown(net.minecraft.network.chat.Component text, int maxWidth, int amount) Adds a centered multi-line text widget with a custom max width and height offset. -
width
public ScreenBuilder.ScreenValue width(net.dillon.dillonlib.screen.ScreenBuilder.ScreenPos pos, net.dillon.dillonlib.screen.ScreenBuilder.Type type) - Parameters:
pos- the screen position.- Returns:
- the width at a specific screen position.
-
width
- Parameters:
widget- the widget to reset width to.- Returns:
- the width at the widget's position.
-
widthCenter
Calculates the width at the center, and returns the new value. -
widthBottomSideLeft
Calculates the width at the bottom left, and returns the new value. -
widthBottomSideRight
Calculates the width at the bottom right, and returns the new value. -
widthRight
Calculates the current width moved right bydefaultOffset(), and returns the new value. -
widthRight
Calculates the current width moved right, and returns the new value. -
widthLeft
Calculates the current width moved left bydefaultOffset(), and returns the new value. -
widthLeft
Calculates the current width moved left, and returns the new value. -
graphicsWidth
public ScreenBuilder.ScreenValue graphicsWidth(net.minecraft.client.gui.components.AbstractWidget widget) - Parameters:
widget- the widget to reset graphics width to.- Returns:
- the graphics width at the widget's position.
-
graphicsWidthCenter
Calculates the graphics width at the center, and returns the new value. -
graphicsWidthSideLeft
Calculates the graphics width at the bottom left, and returns the new value. -
graphicsWidthSideRight
Calculates the graphics width at the bottom right, and returns the new value. -
graphicsWidthRight
Calculates the current graphics width moved right bydefaultGraphicsOffset(), and returns the new value. -
graphicsWidthRight
Calculates the current graphics width moved right, and returns the new value. -
graphicsWidthLeft
Calculates the current graphics width moved left bydefaultGraphicsOffset(), and returns the new value. -
graphicsWidthLeft
Calculates the current graphics width moved left, and returns the new value. -
height
public ScreenBuilder.ScreenValue height(net.dillon.dillonlib.screen.ScreenBuilder.ScreenPos pos, net.dillon.dillonlib.screen.ScreenBuilder.Type type) Calculates the height at a specific screen position, and returns the new value. -
height
- Parameters:
widget- the widget to reset height to.- Returns:
- the height at the widget's position.
-
heightBottom
Calculates the height at the bottom center, and returns the new value. -
heightCenter
Calculates the height at the center, and returns the new value. -
heightTop
Calculates the height at the top center, and returns the new value. -
heightDown
Calculates the current height moved down bydefaultOffset(), and returns the new value. -
heightDown
Calculates the current height moved down, and returns the new value. -
heightUp
Calculates the current height moved up bydefaultOffset(), and returns the new value. -
heightUp
Calculates the current height moved up, and returns the new value. -
graphicsHeight
public ScreenBuilder.ScreenValue graphicsHeight(net.minecraft.client.gui.components.AbstractWidget widget) - Parameters:
widget- the widget to reset graphics height to.- Returns:
- the graphics height at the widget's position.
-
graphicsHeightBottom
Calculates the graphics height at the bottom center, and returns the new value. -
graphicsHeightCenter
Calculates the graphics height at the center, and returns the new value. -
graphicsHeightTop
Calculates the graphics height at the top center, and returns the new value. -
graphicsHeightDown
Calculates the current graphics height moved down bydefaultGraphicsOffset(), and returns the new value. -
graphicsHeightDown
Calculates the current graphics height moved down, and returns the new value. -
graphicsHeightUp
Calculates the current graphics height moved up bydefaultOffset(), and returns the new value. -
graphicsHeightUp
Calculates the current graphics height moved up, and returns the new value.
-