SVGAContext
基础库版本 >=
3.31.0
开始支持,低版本需做兼容处理
SVGAContext 实例,可通过 bl.createSVGAContext 接口获取实例。
SVGAContext 通过 id 跟一个 cover-svga 组件绑定,操作对应的 cover-svga 组件。
方法
SVGAContext.play(array range, boolean reverse)
开始播放
SVGAContext.pause()
暂停播放
SVGAContext.stop()
停止播放
SVGAContext.seekToFrame(number frame, boolean play)
跳转到指定帧
SVGAContext.seekToPercentage(number percentage, boolean play)
跳转到指定进度
SVGAContext.setVisibility(string key, boolean hidden)
改变指定元素的可见性
SVGAContext.setImage(string key, string src)
替换指定元素为一张图片
SVGAContext.setText(string key, string text, number size, string color)
在指定元素上添加文字
SVGAContext.clearDynamicObjects()
重置所有的动态元素设置