GuiBaublesButton
基本信息
| 属性 | 值 |
|---|---|
| 路径 | baubles.client.gui.GuiBaublesButton |
| 类型 | class |
| 父类 | GuiButton |
| 包名 | baubles.client.gui |
| 按钮 ID | 55(在 GuiEvents 中固定) |
构造
GuiBaublesButton(int buttonId, int xIn, int yIn, int widthIn, int heightIn, String resource)
渲染
覆写 drawButton:
- 旧版(
useOldGuiButton=true):使用 GuiPlayerExpanded.background 资源,10×10 像素贴图,分别用 u=200/210 区分 hover/normal - 新版(默认):使用 GuiPlayerExpanded.gui_background 资源,14×14 像素贴图,分别用 v=0/14 区分 hover/normal,并渲染一个带紫色渐变边框的标签
displayString
与 GuiEvents 配合
- 当 hover 时只绘制贴图不绘制标签
- normal 时根据
useOldGuiButton切换贴图与标签渲染
相关条目
- GuiEvents - 注册按钮并响应点击
- GuiPlayerExpanded - 提供贴图资源
- BaublesConfig -
useOldGuiButton配置