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
public static class RenderTooltipEvent.Pre extends 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.Post, RenderTooltipEvent.PostBackground, RenderTooltipEvent.PostText, RenderTooltipEvent.Pre
-
-
Field Summary
Fields Modifier and Type Field Description private int
maxWidth
private int
screenHeight
private int
screenWidth
-
Fields inherited from class net.minecraftforge.client.event.RenderTooltipEvent
fr, lines, matrixStack, stack, x, y
-
-
Constructor Summary
Constructors Constructor Description Pre(ItemStack stack, java.util.List<? extends ITextProperties> lines, MatrixStack matrixStack, int x, int y, int screenWidth, int screenHeight, int maxWidth, FontRenderer fr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getMaxWidth()
int
getScreenHeight()
int
getScreenWidth()
void
setFontRenderer(FontRenderer fr)
Sets theFontRenderer
to be used to render text.void
setMaxWidth(int maxWidth)
Sets the max width of the tooltip.void
setScreenHeight(int screenHeight)
void
setScreenWidth(int screenWidth)
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
getFontRenderer, getLines, getMatrixStack, getStack, getX, getY
-
-
-
-
Constructor Detail
-
Pre
public Pre(@Nonnull ItemStack stack, @Nonnull java.util.List<? extends ITextProperties> lines, MatrixStack matrixStack, int x, int y, int screenWidth, int screenHeight, int maxWidth, @Nonnull FontRenderer fr)
-
-
Method Detail
-
getScreenWidth
public int getScreenWidth()
-
setScreenWidth
public void setScreenWidth(int screenWidth)
-
getScreenHeight
public int getScreenHeight()
-
setScreenHeight
public void setScreenHeight(int screenHeight)
-
getMaxWidth
public int getMaxWidth()
- Returns:
- The max width the tooltip can be. Defaults to -1 (unlimited).
-
setMaxWidth
public void setMaxWidth(int maxWidth)
Sets the max width of the tooltip. Use -1 for unlimited.
-
setFontRenderer
public void setFontRenderer(@Nonnull FontRenderer fr)
Sets theFontRenderer
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.
-
-