自定义ESC界面
第一步,在服务端中新建GermPlugin/gui/game_esc.yml,并填入对应基础配置
game_esc:
背景图:
enable: true
type: texture
path: 'local<->textures/esc/esc.png'
locationX: "w*0.354"
locationY: "h*0.169"
width: "0.9*w*0.319"
height: "0.9*h*0.608"
back:
type: button
defaultPath: 'local<->textures/esc/button.png'
hoverPath: 'local<->textures/esc/button_.png'
clickSound: 'minecraft:ui.button.click'
locationX: "w*0.347"
locationY: "h*0.77"
width: "w*0.07"
height: "h*0.036"
返回游戏:
type: label
align: "center"
scale: 'h*0.002'
texts:
- "&f返回游戏"
locationX: "w*0.383"
locationY: "h*0.781"
settings:
type: button
defaultPath: 'local<->textures/esc/button.png'
hoverPath: 'local<->textures/esc/button_.png'
clickSound: 'minecraft:ui.button.click'
locationX: "w*0.426"
locationY: "h*0.77"
width: "w*0.07"
height: "h*0.036"
设置:
type: label
align: "center"
scale: 'h*0.002'
texts:
- "&f设置"
locationX: "w*0.460"
locationY: "h*0.781"
advancements:
type: button
defaultPath: 'local<->textures/esc/button.png'
hoverPath: 'local<->textures/esc/button_.png'
clickSound: 'minecraft:ui.button.click'
locationX: "w*0.505"
locationY: "h*0.77"
width: "w*0.071"
height: "h*0.036"
进度:
type: label
align: "center"
scale: 'h*0.002'
texts:
- "&f进度"
locationX: "w*0.541"
locationY: "h*0.781"
quit:
type: button
defaultPath: 'local<->textures/esc/button.png'
hoverPath: 'local<->textures/esc/button_.png'
clickSound: 'minecraft:ui.button.click'
locationX: "w*0.586"
locationY: "h*0.77"
width: "w*0.071"
height: "h*0.036"
退出游戏:
type: label
align: "center"
scale: 'h*0.002'
texts:
- "&f退出游戏"
locationX: "w*0.622"
locationY: "h*0.781"
按钮1:
type: button
defaultPath: 'local<->textures/esc/button1.png'
hoverPath: 'local<->textures/esc/button1.png'
hoverSound: 'minecraft:ui.button.click'
clickSound: 'minecraft:ui.button.click'
hoverAnimations:
- "button_scale"
locationX: "w*0.382"
locationY: "h*0.185"
width: "0.9*w*0.0520"
height: "0.9*h*0.1"
clickDos:
- "open<->null"
label_1:
type: label
align: "center"
scale: '0.9*w*0.0015'
texts:
- "按钮1"
locationX: "w*0.406"
locationY: "h*0.285"
按钮2:
type: button
defaultPath: 'local<->textures/esc/button2.png'
hoverPath: 'local<->textures/esc/button2.png'
hoverSound: 'minecraft:ui.button.click'
clickSound: 'minecraft:ui.button.click'
hoverAnimations:
- "button_scale"
locationX: "w*0.442"
locationY: "h*0.185"
width: "0.9*w*0.0520"
height: "0.9*h*0.1"
clickDos:
- "open<->null"
label_2:
type: label
align: "center"
scale: '0.9*w*0.0015'
texts:
- "按钮2"
locationX: "w*0.466"
locationY: "h*0.285"
第二步,按照第二节的教程调整背景大小并添加你的需要的组件吧 😝