[LayaAir 2.0]laya生成的layaContainer div想用appendChild方法添加到某div下,但是针对sprite距离位置并没有变化
showModal() {
Laya.init(800, 500, WebGL);
Laya.stage.bgColor = "#ffffff";
console.log(Laya.Render._mainCanvas);
Laya.Render._mainCanvas.source.style.top = "50px";
this.setup();
const parent = document.getElementById("preview");
const child = document.getElementById("layaContainer");
parent.appendChild(child);
console.log(this.rect);
}
Laya.init(800, 500, WebGL);
Laya.stage.bgColor = "#ffffff";
console.log(Laya.Render._mainCanvas);
Laya.Render._mainCanvas.source.style.top = "50px";
this.setup();
const parent = document.getElementById("preview");
const child = document.getElementById("layaContainer");
parent.appendChild(child);
console.log(this.rect);
}
没有找到相关结果
已邀请:
要回复问题请先登录
0 个回复