文档地址:https://ldc.layabox.com/doc/?nav=zh-js-1-3-1
目录:位图-设置遮罩
4.2 使用IDE生成的类与图集,实现遮罩效果
里边的示例运行报错 Uncaught TypeError: this.setTo is not a function
(function () {
const Loader = Laya.Loader
const Handler = Laya.Handler
(function () {
Laya.init(1136,640)
Laya.stage.bgColor="#fff"
Laya.loader.load('./../bin/res/atlas/res.atlas', Handler.create(this, onLoaded))
})()
function onLoaded() {
var cMask = new maskDemoUI()
Laya.stage.addChild(cMask)
}
})()