Package net.minecraftforge.client.event
Class RenderTooltipEvent.Pre
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.RenderTooltipEvent
net.minecraftforge.client.event.RenderTooltipEvent.Pre
- Enclosing class:
- RenderTooltipEvent
This event is fired before any tooltip calculations are done. It provides setters for all aspects of the tooltip, so the final render can be modified.
This event is Cancelable
.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.client.event.RenderTooltipEvent
RenderTooltipEvent.Color, RenderTooltipEvent.GatherComponents, RenderTooltipEvent.Post, RenderTooltipEvent.PostBackground, RenderTooltipEvent.PostText, RenderTooltipEvent.Pre
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionprivate int
private int
private int
Fields inherited from class net.minecraftforge.client.event.RenderTooltipEvent
components, fr, lines, matrixStack, stack, x, y
-
Constructor Summary
ConstructorDescriptionPre(ItemStack stack, PoseStack matrixStack, int x, int y, int screenWidth, int screenHeight, Font font, List<ClientTooltipComponent> components)
Pre(ItemStack stack, List<? extends FormattedText> lines, PoseStack matrixStack, int x, int y, int screenWidth, int screenHeight, int maxWidth, Font fr)
Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionint
Deprecated, for removal: This API element is subject to removal in a future version.int
int
void
setFontRenderer(Font fr)
Sets theFont
to be used to render text.void
setMaxWidth(int maxWidth)
Deprecated, for removal: This API element is subject to removal in a future version.void
setScreenHeight(int screenHeight)
Deprecated, for removal: This API element is subject to removal in a future version.void
setScreenWidth(int screenWidth)
Deprecated, for removal: This API element is subject to removal in a future version.void
setX(int x)
Set the X origin of the tooltip.void
setY(int y)
Set the Y origin of the tooltip.Methods inherited from class net.minecraftforge.client.event.RenderTooltipEvent
getComponents, getFontRenderer, getLines, getMatrixStack, getStack, getX, getY
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
-
Field Details
-
screenWidth
private int screenWidth -
screenHeight
private int screenHeight -
maxWidth
private int maxWidth
-
-
Constructor Details
-
Pre
@Deprecated(since="1.18", forRemoval=true) public Pre(@Nonnull ItemStack stack, @Nonnull List<? extends FormattedText> lines, PoseStack matrixStack, int x, int y, int screenWidth, int screenHeight, int maxWidth, @Nonnull Font fr)Deprecated, for removal: This API element is subject to removal in a future version. -
Pre
public Pre(@Nonnull ItemStack stack, PoseStack matrixStack, int x, int y, int screenWidth, int screenHeight, @Nonnull Font font, @Nonnull List<ClientTooltipComponent> components)
-
-
Method Details
-
getScreenWidth
public int getScreenWidth() -
setScreenWidth
Deprecated, for removal: This API element is subject to removal in a future version. -
getScreenHeight
public int getScreenHeight() -
setScreenHeight
Deprecated, for removal: This API element is subject to removal in a future version. -
getMaxWidth
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- The max width the tooltip can be. Defaults to -1 (unlimited).
-
setMaxWidth
Deprecated, for removal: This API element is subject to removal in a future version.Sets the max width of the tooltip. Use -1 for unlimited. -
setFontRenderer
Sets theFont
to be used to render text. -
setX
public void setX(int x)Set the X origin of the tooltip. -
setY
public void setY(int y)Set the Y origin of the tooltip.
-
RenderTooltipEvent.GatherComponents