Commit eff05818 authored by liujiangnan's avatar liujiangnan

feat

parent b0b1a4e8
...@@ -135,7 +135,11 @@ export default class NewClass extends cc.Component { ...@@ -135,7 +135,11 @@ export default class NewClass extends cc.Component {
cc.find(`unlock`, itemClone).active = true; cc.find(`unlock`, itemClone).active = true;
cc.find(`unlock/text`, itemClone).getComponent(cc.Label).string = row.name; cc.find(`unlock/text`, itemClone).getComponent(cc.Label).string = row.name;
getSpriteFrimeByUrl(row.cover, (spriteFrame) => { getSpriteFrimeByUrl(row.cover, (spriteFrame) => {
cc.find(`unlock/cover`, itemClone).getComponent(cc.Sprite).spriteFrame = spriteFrame; const coverNode = cc.find(`unlock/cover`, itemClone);
coverNode.getComponent(cc.Sprite).spriteFrame = spriteFrame;
const sx = coverNode.width / 70;
const sy = coverNode.height / 80;
coverNode.scale = Math.min(sx, sy);
}); });
} }
}); });
......
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