Commit 191ca976 authored by 范雪寒's avatar 范雪寒

feat: 背景图缩放 try 3

parent a7296fd5
......@@ -155,11 +155,11 @@ cc.Class({
this.coolCatSpeakStart();
const canvas = cc.find('Canvas');
const bg = cc.find('Canvas/ImgBg');
await this.asyncLoadSpriteByUrl(bg, this.data.bgItem.url);
const canvas = cc.find('Canvas');
bg.scale = Math.min((canvas.width / bg.width), (canvas.height / bg.height));
bg.scale = Math.max(1, canvas.width / bg.width, canvas.height / bg.height);
this.itemList = [];
this.data.hotZoneItemArr.forEach(async itemData => {
......
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