Commit 691f0bf2 authored by 范雪寒's avatar 范雪寒

feat:

parent 77248af9
......@@ -249,10 +249,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
const pageData = this.data.pageArr[this.currentPageIdx];
const bgRect = pageData.bgItem.rect;
console.log(pageData);
const partImg = cc.find('Canvas/step2/pad/mask/page');
this.setNodeSpirteFrameByUrl(pageUrl, partImg, () => {
// partImg.scale = partImg.parent.height / partImg.height;
const rect = pageData.hotZoneItemArr[this.currentPartIdx].rect;
const x = ((rect.x + rect.width / 2) - bgRect.width / 2) * partImg.width / bgRect.width;
const y = (bgRect.height / 2 - (rect.y + rect.height / 2)) * partImg.height / bgRect.height;
partImg.x = x;
partImg.y = y;
});
const book_left = cc.find('Canvas/step1/book_left');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment