cocos-awesome/assets/Scene/Circle_avatar/Circle_avatar.ts
2020-04-28 01:03:02 +08:00

12 lines
304 B
TypeScript

const { ccclass, property } = cc._decorator;
@ccclass
export default class CircleAvatar extends cc.Component {
@property(cc.Sprite)
rectAvatar: cc.Sprite = null;
start() {
this.rectAvatar.getMaterial(0).setProperty('wh_ratio', this.rectAvatar.node.width / this.rectAvatar.node.height);
}
}