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.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
fr, lines, matrixStack, stack, x, y
-
Constructor Summary
ConstructorDescriptionPre
(ItemStack stack, List<? extends ITextProperties> lines, MatrixStack matrixStack, int x, int y, int screenWidth, int screenHeight, int maxWidth, FontRenderer fr) -
Method Summary
Modifier and TypeMethodDescriptionint
int
int
void
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
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
public Pre(@Nonnull ItemStack stack, @Nonnull List<? extends ITextProperties> lines, MatrixStack matrixStack, int x, int y, int screenWidth, int screenHeight, int maxWidth, @Nonnull FontRenderer fr)
-
-
Method Details
-
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
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.
-