Commit 8c3be706 authored by 范雪寒's avatar 范雪寒

fix: loadSpriteByUrl

parent 7e19cd8b
......@@ -444,6 +444,9 @@ cc.Class({
// ------------------------------------------------
loadSpriteByUrl(node, url, cb) {
cc.loader.load({ url }, (err, img) => {
if (!node) {
cb && cb();
}
const spriteFrame = new cc.SpriteFrame(img)
const spr = node.getComponent(cc.Sprite);
spr.spriteFrame = spriteFrame;
......
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