类 RenderTooltipEvent.Color
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.RenderTooltipEvent
net.minecraftforge.client.event.RenderTooltipEvent.Color
- 封闭类:
- RenderTooltipEvent
Fired when the colours for the tooltip background are determined.
This can be used to modify the background color and the border's gradient colors.
This event is not cancellable, and does not have a result.
This event is fired on the main Forge event bus, only on the logical client.
-
嵌套类概要
从类继承的嵌套类/接口 net.minecraftforge.client.event.RenderTooltipEvent
RenderTooltipEvent.Color, RenderTooltipEvent.GatherComponents, RenderTooltipEvent.Pre
从类继承的嵌套类/接口 net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
字段概要
字段修饰符和类型字段说明private int
private int
private int
private int
private final int
private final int
private final int
从类继承的字段 net.minecraftforge.client.event.RenderTooltipEvent
components, font, graphics, itemStack, x, y
-
构造器概要
构造器构造器说明Color
(@NotNull ItemStack stack, GuiGraphics graphics, int x, int y, @NotNull Font fr, int background, int borderStart, int borderEnd, @NotNull List<ClientTooltipComponent> components) -
方法概要
修饰符和类型方法说明int
返回 the gradient end color for the tooltip background (bottom edge)。int
返回 the gradient start color for the tooltip background (top edge)。int
返回 the gradient end color for the tooltip border (bottom edge)。int
返回 the gradient start color for the tooltip border (top edge)。int
返回 the original tooltip background's gradient end color (bottom edge)。int
返回 the original tooltip background's gradient start color (top edge)。int
返回 the original tooltip border's gradient end color (bottom edge)。int
返回 the original tooltip border's gradient start color (top edge)。void
setBackground
(int background) Sets the new color for the tooltip background.void
setBackgroundEnd
(int backgroundEnd) Sets the new end color for the gradient of the tooltip background (bottom edge).void
setBackgroundStart
(int backgroundStart) Sets the new start color for the gradient of the tooltip background (top edge).void
setBorderEnd
(int borderEnd) Sets the new end color for the gradient of the tooltip border (bottom edge).void
setBorderStart
(int borderStart) Sets the new start color for the gradient of the tooltip border (top edge).从类继承的方法 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
-
字段详细资料
-
originalBackground
private final int originalBackground -
originalBorderStart
private final int originalBorderStart -
originalBorderEnd
private final int originalBorderEnd -
backgroundStart
private int backgroundStart -
backgroundEnd
private int backgroundEnd -
borderStart
private int borderStart -
borderEnd
private int borderEnd
-
-
构造器详细资料
-
Color
@Internal public Color(@NotNull @NotNull ItemStack stack, GuiGraphics graphics, int x, int y, @NotNull @NotNull Font fr, int background, int borderStart, int borderEnd, @NotNull @NotNull List<ClientTooltipComponent> components)
-
-
方法详细资料
-
getBackgroundStart
public int getBackgroundStart()返回 the gradient start color for the tooltip background (top edge)。- 返回:
- the gradient start color for the tooltip background (top edge)
-
getBackgroundEnd
public int getBackgroundEnd()返回 the gradient end color for the tooltip background (bottom edge)。- 返回:
- the gradient end color for the tooltip background (bottom edge)
-
setBackground
public void setBackground(int background) Sets the new color for the tooltip background. This sets both the gradient start and end color for the background to this color.- 参数:
background
- the new color for the tooltip background
-
setBackgroundStart
public void setBackgroundStart(int backgroundStart) Sets the new start color for the gradient of the tooltip background (top edge).- 参数:
backgroundStart
- the new start color for the tooltip background
-
setBackgroundEnd
public void setBackgroundEnd(int backgroundEnd) Sets the new end color for the gradient of the tooltip background (bottom edge).- 参数:
backgroundEnd
- the new end color for the tooltip background
-
getBorderStart
public int getBorderStart()返回 the gradient start color for the tooltip border (top edge)。- 返回:
- the gradient start color for the tooltip border (top edge)
-
setBorderStart
public void setBorderStart(int borderStart) Sets the new start color for the gradient of the tooltip border (top edge).- 参数:
borderStart
- the new start color for the tooltip border
-
getBorderEnd
public int getBorderEnd()返回 the gradient end color for the tooltip border (bottom edge)。- 返回:
- the gradient end color for the tooltip border (bottom edge)
-
setBorderEnd
public void setBorderEnd(int borderEnd) Sets the new end color for the gradient of the tooltip border (bottom edge).- 参数:
borderEnd
- the new end color for the tooltip border
-
getOriginalBackgroundStart
public int getOriginalBackgroundStart()返回 the original tooltip background's gradient start color (top edge)。- 返回:
- the original tooltip background's gradient start color (top edge)
-
getOriginalBackgroundEnd
public int getOriginalBackgroundEnd()返回 the original tooltip background's gradient end color (bottom edge)。- 返回:
- the original tooltip background's gradient end color (bottom edge)
-
getOriginalBorderStart
public int getOriginalBorderStart()返回 the original tooltip border's gradient start color (top edge)。- 返回:
- the original tooltip border's gradient start color (top edge)
-
getOriginalBorderEnd
public int getOriginalBorderEnd()返回 the original tooltip border's gradient end color (bottom edge)。- 返回:
- the original tooltip border's gradient end color (bottom edge)
-