GameClubButton
游戏圈按钮。游戏圈按钮被点击后会跳转到小游戏的游戏圈。更多关于游戏圈的信息见 游戏圈使用指南
属性
string icon
游戏圈按钮的图标,仅当 type 参数为 image 时有效。
icon 的合法值
| 值 | 说明 | 最低版本 |
|---|---|---|
| green | 绿色的图标 | |
| white | 白色的图标 | |
| dark | 有黑色圆角背景的白色图标 | |
| light | 有白色圆角背景的绿色图标 |
string type
按钮的类型
type 的合法值
| 值 | 说明 | 最低版本 |
|---|---|---|
| text | 可以设置背景色和文本的按钮 | |
| image | 只能设置背景贴图的按钮,背景贴图会直接拉伸到按钮的宽高 |
string text
按钮上的文本,仅当 type 为 text 时有效
string image
按钮的背景图片,仅当 type 为 image 时有效
Object style
按钮的样式
| 属性 | 类型 | 说明 |
|---|---|---|
| left | number | 左上角横坐标 |
| top | number | 左上角纵坐标 |
| width | number | 宽度 |
| height | number | 高度 |
| backgroundColor | string | 背景颜色 |
| borderColor | string | 边框颜色 |
| borderWidth | number | 边框宽度 |
| borderRadius | number | 边框圆角 |
| textAlign | string | 文本的水平居中方式 |
| fontSize | number | 字号 |
| lineHeight | number | 文本的行高 |
style.textAlign 的合法值
| 值 | 说明 | 最低版本 |
|---|---|---|
| left | 居左 | |
| center | 居中 | |
| right | 居右 |
方法
GameClubButton.show()
显示游戏圈按钮
GameClubButton.hide()
隐藏游戏圈按钮
GameClubButton.destroy()
销毁游戏圈按钮
GameClubButton.onTap(function callback)
监听游戏圈按钮的点击事件
GameClubButton.offTap(function callback)
取消监听游戏圈按钮的点击事件