12345678910111213141516 |
- const Api = require('../net/Api');
- cc.Class({
- extends: cc.Component,
- properties: {
- avatarSprite: cc.Sprite,
- },
- setAvatar(path) {
- Api.createImageFromUrl(path, (spriteFrame) => {
- this.avatarSprite.spriteFrame = spriteFrame;
- });
- },
- // update (dt) {},
- });
|