Package net.minecraftforge.client.event
Class RenderTooltipEvent
- java.lang.Object
-
- net.minecraftforge.eventbus.api.Event
-
- net.minecraftforge.client.event.RenderTooltipEvent
-
- Direct Known Subclasses:
RenderTooltipEvent.Color
,RenderTooltipEvent.Post
,RenderTooltipEvent.Pre
public abstract class RenderTooltipEvent extends net.minecraftforge.eventbus.api.Event
A set of events which are fired at various points during tooltip rendering.Can be used to change the rendering parameters, draw something extra, etc.
Do not use this event directly, use one of the subclasses:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RenderTooltipEvent.Color
This event is fired when the colours for the tooltip background are determined.protected static class
RenderTooltipEvent.Post
Events inheriting from this class are fired at different stages during the tooltip rendering.static class
RenderTooltipEvent.PostBackground
This event is fired directly after the tooltip background is drawn, but before any text is drawn.static class
RenderTooltipEvent.PostText
This event is fired directly after the tooltip text is drawn, but before the GL state is reset.static class
RenderTooltipEvent.Pre
This event is fired before any tooltip calculations are done.
-
Field Summary
Fields Modifier and Type Field Description protected FontRenderer
fr
protected java.util.List<? extends ITextProperties>
lines
protected MatrixStack
matrixStack
protected ItemStack
stack
protected int
x
protected int
y
-
Constructor Summary
Constructors Constructor Description RenderTooltipEvent(ItemStack stack, java.util.List<? extends ITextProperties> lines, MatrixStack matrixStack, int x, int y, FontRenderer fr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FontRenderer
getFontRenderer()
java.util.List<? extends ITextProperties>
getLines()
The lines to be drawn.MatrixStack
getMatrixStack()
ItemStack
getStack()
int
getX()
int
getY()
-
-
-
Field Detail
-
stack
@Nonnull protected final ItemStack stack
-
lines
protected final java.util.List<? extends ITextProperties> lines
-
matrixStack
protected final MatrixStack matrixStack
-
x
protected int x
-
y
protected int y
-
fr
protected FontRenderer fr
-
-
Constructor Detail
-
RenderTooltipEvent
public RenderTooltipEvent(@Nonnull ItemStack stack, @Nonnull java.util.List<? extends ITextProperties> lines, MatrixStack matrixStack, int x, int y, @Nonnull FontRenderer fr)
-
-
Method Detail
-
getStack
@Nonnull public ItemStack getStack()
- Returns:
- The stack which the tooltip is being rendered for. As tooltips can be drawn without itemstacks, this stack may be empty.
-
getLines
@Nonnull public java.util.List<? extends ITextProperties> getLines()
The lines to be drawn. May change betweenRenderTooltipEvent.Pre
andRenderTooltipEvent.Post
.- Returns:
- An unmodifiable list of strings. Use
ItemTooltipEvent
to modify tooltip text.
-
getMatrixStack
public MatrixStack getMatrixStack()
- Returns:
- The MatrixStack of the current rendering context
-
getX
public int getX()
- Returns:
- The X position of the tooltip box. By default, the mouse X position.
-
getY
public int getY()
- Returns:
- The Y position of the tooltip box. By default, the mouse Y position.
-
getFontRenderer
@Nonnull public FontRenderer getFontRenderer()
- Returns:
- The
FontRenderer
instance the current render is using.
-
-