mirror of
https://github.com/ifengzp/cocos-awesome.git
synced 2024-12-26 11:49:18 +00:00
12 lines
304 B
TypeScript
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);
|
|
}
|
|
}
|