

export default class RankItem extends eui.ItemRenderer {
    public userRankNum: eui.Label;
    public userId: eui.Label;
    public userScore: eui.Label;
    public num3: eui.Image;
    public num2: eui.Image;
    public num1: eui.Image;
    public petImg: eui.Image;


    constructor() {
        super();
        this.skinName = "resource/skins/RankItemSkin.exml";
    }




    dataChanged() {
        // super.dataChanged();
        // console.log(this.data, this)
        // debugger
        if (this.petImg) {
            if (this.data.maxLevel <= 10) {
                this.petImg.source = `dog_lv_${this.data.maxLevel}_png`;
                console.log("this.petImg.width")
                console.log(this.petImg.height)
                this.petImg.anchorOffsetY=this.petImg.height/2
            }
        }

        if (this.userScore) {
            this.userScore.text = `x${this.data.maxLevelCnt}`
        }

    }
}