tt.createInteractiveButton收藏我的收藏
收藏
我的收藏基础库 2.46.0 开始支持此方法,这是一个异步方法
该方法创建一个 Native 按钮,位于小游戏层级最上面,覆盖在小游戏 Canvas 画布上。通过该方法创建的按钮在录屏时,不会被采集进录屏画面。开发者可以通过创建此类按钮,优化录屏效果,减少录屏画面的元素内容
语法
tt.createInteractiveButton(options);
参数说明
options 为 object 类型,属性如下:
属性名 | 类型 | 默认值 | 必填 | 说明 | 最低支持版本 |
---|---|---|---|---|---|
type | string | text | 是 | 按钮类型: text 、 image | 2.46.0 |
text | string | 按钮类型为 text,这个字段必须填 | 按钮上显示的文本 | 2.46.0 | |
image | string | 按钮类型为 image ,这个字段必填 | 按钮上显示图片的路径, 可以接受网络地址,本地 ttfile:// 协议地址,以及相对路径 | 2.46.0 | |
style | object |