LoadingDotsWidget.java
net.minecraft.client.gui.components.LoadingDotsWidget
信息
- 全限定名:net.minecraft.client.gui.components.LoadingDotsWidget
- 类型:public class
- 包:net.minecraft.client.gui.components
- 源码路径:src/main/java/net/minecraft/client/gui/components/LoadingDotsWidget.java
- 起始行号:L17
- 继承:AbstractWidget
- 职责:
TODO
字段/常量
font- 类型:
Font - 修饰符:
private final - 源码定位:
L18 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
public LoadingDotsWidget(Font font, Component message) @ L20
- 构造器名:LoadingDotsWidget
- 源码定位:L20
- 修饰符:public
参数:
- font: Font
- message: Component
说明:
TODO
方法
下面的方法块按源码顺序生成。
protected void extractWidgetRenderState(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a) @ L25
- 方法名:extractWidgetRenderState
- 源码定位:L25
- 返回类型:void
- 修饰符:protected
参数:
- graphics: GuiGraphicsExtractor
- mouseX: int
- mouseY: int
- a: float
说明:
TODO
protected void updateWidgetNarration(NarrationElementOutput output) @ L35
- 方法名:updateWidgetNarration
- 源码定位:L35
- 返回类型:void
- 修饰符:protected
参数:
- output: NarrationElementOutput
说明:
TODO
public void playDownSound(SoundManager soundManager) @ L39
- 方法名:playDownSound
- 源码定位:L39
- 返回类型:void
- 修饰符:public
参数:
- soundManager: SoundManager
说明:
TODO
public boolean isActive() @ L43
- 方法名:isActive
- 源码定位:L43
- 返回类型:boolean
- 修饰符:public
参数:
- 无
说明:
TODO
public ComponentPath nextFocusPath(FocusNavigationEvent navigationEvent) @ L48
- 方法名:nextFocusPath
- 源码定位:L48
- 返回类型:ComponentPath
- 修饰符:public
参数:
- navigationEvent: FocusNavigationEvent
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class LoadingDotsWidget extends AbstractWidget {
private final Font font;
public LoadingDotsWidget(Font font, Component message) {
super(0, 0, font.width(message), 9 * 3, message);
this.font = font;
}
@Override
protected void extractWidgetRenderState(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a) {
int centerX = this.getX() + this.getWidth() / 2;
int centerY = this.getY() + this.getHeight() / 2;
Component message = this.getMessage();
graphics.text(this.font, message, centerX - this.font.width(message) / 2, centerY - 9, -1);
String dots = LoadingDotsText.get(Util.getMillis());
graphics.text(this.font, dots, centerX - this.font.width(dots) / 2, centerY + 9, -8355712);
}
@Override
protected void updateWidgetNarration(NarrationElementOutput output) {
}
@Override
public void playDownSound(SoundManager soundManager) {
}
@Override
public boolean isActive() {
return false;
}
@Override
public @Nullable ComponentPath nextFocusPath(FocusNavigationEvent navigationEvent) {
return null;
}
}引用的其他类
-
- 引用位置:
返回值
- 引用位置:
-
- 引用位置:
参数/字段
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
继承
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
LoadingDotsText.get()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
Util.getMillis()
- 引用位置: