类 RenderTooltipEvent.Pre
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.RenderTooltipEvent
net.minecraftforge.client.event.RenderTooltipEvent.Pre
- 封闭类:
RenderTooltipEvent
Fired before the tooltip is rendered.
This can be used to modify the positioning and font of the tooltip.
This event is cancellable, and does not have a result.
If this event is cancelled, then the tooltip will not be rendered and the corresponding
RenderTooltipEvent.Background
will not be fired.
This event is fired on the main Forge event bus, only on the logical client.
-
嵌套类概要
从类继承的嵌套类/接口 net.minecraftforge.client.event.RenderTooltipEvent
RenderTooltipEvent.Background, RenderTooltipEvent.GatherComponents, RenderTooltipEvent.Pre
从类继承的嵌套类/接口 net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
字段概要
字段从类继承的字段 net.minecraftforge.client.event.RenderTooltipEvent
components, font, graphics, itemStack, x, y
-
构造器概要
构造器构造器说明Pre
(@NotNull ItemStack stack, GuiGraphics graphics, int x, int y, int screenWidth, int screenHeight, @NotNull Font font, @NotNull List<ClientTooltipComponent> components, @NotNull ClientTooltipPositioner positioner) -
方法概要
从类继承的方法 net.minecraftforge.client.event.RenderTooltipEvent
getComponents, getFont, getGraphics, getItemStack, getX, getY
从类继承的方法 net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
字段详细资料
-
screenWidth
private final int screenWidth -
screenHeight
private final int screenHeight -
positioner
-
-
构造器详细资料
-
Pre
@Internal public Pre(@NotNull @NotNull ItemStack stack, GuiGraphics graphics, int x, int y, int screenWidth, int screenHeight, @NotNull @NotNull Font font, @NotNull @NotNull List<ClientTooltipComponent> components, @NotNull @NotNull ClientTooltipPositioner positioner)
-
-
方法详细资料
-
getScreenWidth
public int getScreenWidth()返回 the width of the screen。. The lines of text within the tooltip are wrapped to be within the screen width, and the tooltip box itself is moved to be within the screen width.- 返回:
- the width of the screen
-
getScreenHeight
public int getScreenHeight()返回 the height of the screen。 The tooltip box is moved to be within the screen height.- 返回:
- the height of the screen
-
getTooltipPositioner
-
setFont
Sets the font to be used to render text.- 参数:
fr
- the new font
-
setX
public void setX(int x) Sets the X origin of the tooltip.- 参数:
x
- the new X origin
-
setY
public void setY(int y) Sets the Y origin of the tooltip.- 参数:
y
- the new Y origin
-