Commit 93b891d6 authored by 范雪寒's avatar 范雪寒

feat: asyncLoadSpriteByUrl

parent 0959f380
......@@ -250,9 +250,11 @@ cc.Class({
asyncLoadSpriteByUrl(node, url) {
return new Promise((resolve, reject) => {
cc.loader.load({ url }, (err, img) => {
if (node) {
const spriteFrame = new cc.SpriteFrame(img)
const spr = node.getComponent(cc.Sprite);
spr.spriteFrame = spriteFrame;
}
resolve();
});
});
......
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