12 lines
304 B
TypeScript
Raw Normal View History

2020-04-28 00:39:21 +08:00
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);
}
}