UIDiffSel.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import GBaseUI from "../../gcommon/GBaseUI";
  2. import { GameMng } from "../../GameMng";
  3. import diffCell from "./diffCell";
  4. import { Node,_decorator,instantiate, assetManager, Texture2D, SpriteFrame, Sprite } from "cc";
  5. import { Tools } from "../../Tools";
  6. const {ccclass, property} = _decorator;
  7. @ccclass
  8. export default class UIDiffSel extends GBaseUI {
  9. public static lvArr=['小白','普通','中等','困难','大師','中級大師','高級大師','超級大師'];
  10. public static selectIndex:number=0;
  11. @property({ type: Node })
  12. public content: Node | null = null;
  13. @property({ type: Node })
  14. public testSf: Node | null = null;
  15. start(){
  16. // for(let i=0;i<UIDiffSel.lvArr.length;i++){
  17. // let gnode=instantiate(GameMng.Instance.chessselCell);
  18. // gnode.getComponent(diffCell).setData(i);
  19. // this.content.addChild(gnode);
  20. // }
  21. let self = this;
  22. Tools.loadWeiXinHead("http://xq_img.xwrun.com/PubImgs_avatar_avatar6.png",this.testSf.getComponent(Sprite))
  23. // assetManager.loadRemote("http://xq_img.xwrun.com/PubImgs_avatar_avatar6.png", {ext: ".png"}, (err,data:Texture2D)=>{
  24. // if (!err && data) {
  25. // var sp = new SpriteFrame()
  26. // sp.texture = data;
  27. // self.getComponent(Sprite).spriteFrame = sp;
  28. // }else{
  29. // console.log("loadWeiXinHead ", err);
  30. // }
  31. // });
  32. }
  33. }