CommonFriend.js 315 B

12345678910111213141516
  1. const Api = require('../net/Api');
  2. cc.Class({
  3. extends: cc.Component,
  4. properties: {
  5. avatarSprite: cc.Sprite,
  6. },
  7. setAvatar(path) {
  8. Api.createImageFromUrl(path, (spriteFrame) => {
  9. this.avatarSprite.spriteFrame = spriteFrame;
  10. });
  11. },
  12. // update (dt) {},
  13. });