|
@@ -30,6 +30,17 @@ export class widget_base extends Component {
|
|
|
this.mData = data;
|
|
|
this.icon.getComponent(UITransform).contentSize = new Size(this.mData.att.width,this.mData.att.height)
|
|
|
this.icon.position = new Vec3(this.mData.att.x,this.mData.att.y)
|
|
|
+
|
|
|
+ var anchor_x = 0.5
|
|
|
+ if(this.mData.att.anchor_x!=undefined&&this.mData.att.anchor_x!=null) {
|
|
|
+ anchor_x = this.mData.att.anchor_x
|
|
|
+ }
|
|
|
+ var anchor_y = 0.5
|
|
|
+ if(this.mData.att.anchor_x!=undefined&&this.mData.att.anchor_x!=null) {
|
|
|
+ anchor_y = this.mData.att.anchor_y
|
|
|
+ }
|
|
|
+ this.icon.getComponent(UITransform).setAnchorPoint(anchor_x, anchor_y)
|
|
|
+
|
|
|
if(this.mData.att.rotation == undefined || this.mData.att.rotation == null) {
|
|
|
this.icon.angle = 0
|
|
|
} else {
|