12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import GBaseUI from "../../gcommon/GBaseUI";
- import { GameMng } from "../../GameMng";
- import diffCell from "./diffCell";
- import { Node,_decorator,instantiate, assetManager, Texture2D, SpriteFrame, Sprite } from "cc";
- import { Tools } from "../../Tools";
- const {ccclass, property} = _decorator;
- @ccclass
- export default class UIDiffSel extends GBaseUI {
- public static lvArr=['小白','普通','中等','困难','大師','中級大師','高級大師','超級大師'];
- public static selectIndex:number=0;
- @property({ type: Node })
- public content: Node | null = null;
- @property({ type: Node })
- public testSf: Node | null = null;
-
- start(){
-
- // for(let i=0;i<UIDiffSel.lvArr.length;i++){
- // let gnode=instantiate(GameMng.Instance.chessselCell);
- // gnode.getComponent(diffCell).setData(i);
- // this.content.addChild(gnode);
-
- // }
- let self = this;
- Tools.loadWeiXinHead("http://xq_img.xwrun.com/PubImgs_avatar_avatar6.png",this.testSf.getComponent(Sprite))
- // assetManager.loadRemote("http://xq_img.xwrun.com/PubImgs_avatar_avatar6.png", {ext: ".png"}, (err,data:Texture2D)=>{
- // if (!err && data) {
- // var sp = new SpriteFrame()
- // sp.texture = data;
-
- // self.getComponent(Sprite).spriteFrame = sp;
- // }else{
- // console.log("loadWeiXinHead ", err);
- // }
- // });
-
- }
- }
|