|
@@ -23,7 +23,14 @@ export class home_bottom_rank_item extends Component {
|
|
|
this.m_data = data
|
|
|
this.m_cb = cb
|
|
|
this.img_car.getComponent(Sprite).spriteFrame = imageCacheManager.getRankCarImageById(data.car_id)
|
|
|
- this.lab_nickname.getComponent(Label).string = data.nickName
|
|
|
+ let lab_component = this.lab_nickname.getComponent(Label)
|
|
|
+ if(data.nickName.length>5) {
|
|
|
+ lab_component.string = data.nickName.substring(0,5) + '...'
|
|
|
+ lab_component.horizontalAlign = Label.HorizontalAlign.LEFT
|
|
|
+ } else {
|
|
|
+ lab_component.horizontalAlign = Label.HorizontalAlign.CENTER
|
|
|
+ lab_component.string = data.nickName
|
|
|
+ }
|
|
|
this.lab_score.getComponent(Label).string = data.score + '分'
|
|
|
}
|
|
|
|