|
@@ -557,8 +557,8 @@ export class widget_item extends Component {
|
|
this.m_att.remark = this.m_att.remark;
|
|
this.m_att.remark = this.m_att.remark;
|
|
this.m_att.height = this.spr.getComponent(UITransform).contentSize.height;
|
|
this.m_att.height = this.spr.getComponent(UITransform).contentSize.height;
|
|
this.m_att.width = this.spr.getComponent(UITransform).contentSize.width;
|
|
this.m_att.width = this.spr.getComponent(UITransform).contentSize.width;
|
|
- this.m_att.anchor_x = this.m_data.att.anchor_x
|
|
|
|
- this.m_att.anchor_y = this.m_data.att.anchor_y
|
|
|
|
|
|
+ this.m_att.anchor_x = this.m_att.anchor_x==undefined?0.5:this.m_att.anchor_x
|
|
|
|
+ this.m_att.anchor_y = this.m_att.anchor_y==undefined?0.5:this.m_att.anchor_y
|
|
this.m_att.rotation = this.m_att.rotation;
|
|
this.m_att.rotation = this.m_att.rotation;
|
|
this.m_att.x = this.node.position.x;
|
|
this.m_att.x = this.node.position.x;
|
|
this.m_att.widget_type = this.m_data.type;
|
|
this.m_att.widget_type = this.m_data.type;
|
|
@@ -580,6 +580,7 @@ export class widget_item extends Component {
|
|
this.node.position = new Vec3(this.m_att.x,this.m_att.y)
|
|
this.node.position = new Vec3(this.m_att.x,this.m_att.y)
|
|
this.node.getComponent(UITransform).setContentSize(new Size( this.m_att.width,this.m_att.height))
|
|
this.node.getComponent(UITransform).setContentSize(new Size( this.m_att.width,this.m_att.height))
|
|
this.spr.angle = this.m_att.rotation
|
|
this.spr.angle = this.m_att.rotation
|
|
|
|
+ this.spr.getComponent(UITransform).setAnchorPoint(new Vec2(this.m_att.anchor_x, this.m_att.anchor_y))
|
|
if(this.m_att.drag_data!=null){
|
|
if(this.m_att.drag_data!=null){
|
|
this.drag.position = new Vec3(this.m_att.drag_data.drag_pos_x,this.m_att.drag_data.drag_pos_y)
|
|
this.drag.position = new Vec3(this.m_att.drag_data.drag_pos_x,this.m_att.drag_data.drag_pos_y)
|
|
this.drag.getComponent(UITransform).setContentSize(new Size(this.m_att.drag_data.drag_size_width ,this.m_att.drag_data.drag_size_height ))
|
|
this.drag.getComponent(UITransform).setContentSize(new Size(this.m_att.drag_data.drag_size_width ,this.m_att.drag_data.drag_size_height ))
|