Commit ac295358 authored by 范雪寒's avatar 范雪寒

feat:

parent 691f0bf2
...@@ -258,6 +258,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -258,6 +258,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
const y = (bgRect.height / 2 - (rect.y + rect.height / 2)) * partImg.height / bgRect.height; const y = (bgRect.height / 2 - (rect.y + rect.height / 2)) * partImg.height / bgRect.height;
partImg.x = x; partImg.x = x;
partImg.y = y; partImg.y = y;
partImg.scale = Math.min(
(partImg.parent.width / partImg.width) * (bgRect.width / rect.width),
(partImg.parent.height / partImg.height) * (bgRect.height / rect.height)
);
}); });
const book_left = cc.find('Canvas/step1/book_left'); 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