手游端自定义NPC按钮组件
手游端自定义NPC界面按钮
<Button|nimg=xx|pimg=xx|text=确定开启|color=255|size=12|width=xx|height=xx|link=@开启盒子>
参数说明:
参数 | 释义 |
|---|---|
Button | 参数头,首字母必须大写,代表本类为按钮 |
nimg | 正常显示图片路径 |
pimg | 按钮按下图片路径 |
text | 按钮上的文字 |
color | 按钮上文字的颜色0-255 |
size | 按钮上文字大小 |
width | 按钮图片宽度(一般默认即可,也可根据需要自行拉伸) |
height | 按钮图片高度(一般默认即可,也可根据需要自行拉伸) |
bag | 拖动物品放入对应包裹 |
dye | 组件染色,使用16进制颜色 |
grey | 1=组件置灰 |
_localZOrder | 组件层级,默认为0,数值越大的越后渲染,越小的越先渲染 |
link | 点击按钮后的触发事件 @label |
link0 | 长按按钮后的触发事件 @label |
link2 | 双击按钮后的触发事件 @label |
注:除了开头参数首字母必须大写,所有参数必须小写,参数内容支持变量,用{ } 插入,比如 size={$STR(P0)}
附:支持设置锚点(坐标起始点)
参数 | 释义 |
|---|---|
ax | 横向锚点 |
ay | 纵向锚点 |
- 左上为|ax=0|ay=1|
- 右下为|ax=1|ay=0|
附:支持设置百分比X,Y(设置百分比后原有的X,Y不生效)
参数 | 释义 |
|---|---|
percentx | 百分比X |
percenty | 百分比Y |
- 具体位置对应父控件的位置
例:
<Layout|children=按钮1|ax=0|ay=1|x=0|y=0|width=200|height=200|color=255><Button|id=按钮1|ax=0.5|ay=1|percentx=50|percenty=50|pimg=public/00000362.png|mimg=public/00000363.png|bag=0|scale=1|nimg=public/00000361.png|size=18|color=255|text=Button>按钮会出现在容器的正中心位置
附:支持旋转
参数 | 释义 |
|---|---|
rotate | 顺时针旋转角度 |
附:支持设置子组件
参数 | 释义 |
|---|---|
children | 子组件id列表,子组件需要有id参数,多个子组件用”,”分割 |
<Button|pimg=public/button/btn_push_01.png|nimg=public/button/btn_push_01.png|color=255|mimg=public/button/btn_push_01.png|size=18|text=Button|children=childtext1,childtext2><Text|id=childtext1|y=45.0|color=255|size=18|text=Text2><Text|id=childtext2|x=45.0|color=255|size=18|text=Text3>附:支持设置tips
参数 | 释义 |
|---|---|
tips | 显示的tips |
tipssize | tips文字大小 |
tipsex | 其他组件的id,作为tips调用(无法与tips共存) |
tipsx | tips偏移X |
tipsy | tips偏移Y |
showtips | 0:长按显示TIPS,1:单击或鼠标悬浮显示TIPS,2:双击显示显示TIPS |
<Img|id=用于显示tips|img=public/button/btn_arrow_01.png><Button|id=3|x=1025|y=250|color=255|grey=1|nimg=public/button/btn_close_01.png|mimg=public/button/btn_chosen_02.png|showtips=1|tipsx=20|tipsy=-20|tipsex=用于显示tips|link2=@exit>
本页面由服务器脚本从原始 DOCX 自动生成。排版如与 Word 略有差异,请以原始 DOCX 为准。