Commit 557a20bb authored by 李维's avatar 李维

修改某些背景图无法匹配的问题

parent 0d47ebc8
......@@ -20,7 +20,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.setNodeSpirteFrameByUrl(startBg, bgNode, (frame)=>{
bgNode.x = bgNode.parent.width / -2;
bgNode.y = bgNode.parent.height / 2;
bgNode.scale = bgNode.parent.height / frame.height;
bgNode.height = bgNode.parent.height;
bgNode.width = (frame.width / frame.height) * bgNode.height;
resolve();
});
......@@ -306,7 +307,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.setNodeSpirteFrameByUrl(startBg, bgNode, (frame)=>{
bgNode.x = bgNode.parent.width / -2;
bgNode.y = bgNode.parent.height / 2;
bgNode.scale = bgNode.parent.height / frame.height;
bgNode.height = bgNode.parent.height;
bgNode.width = (frame.width / frame.height) * bgNode.height;
});
}
......
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