|
@@ -11,6 +11,8 @@ class BindTarget{
|
|
size:Size;
|
|
size:Size;
|
|
pos:Vec3;
|
|
pos:Vec3;
|
|
rotation:number;
|
|
rotation:number;
|
|
|
|
+ anchorPointX:number;
|
|
|
|
+ anchorPointY:number;
|
|
}
|
|
}
|
|
@ccclass('widget_base')
|
|
@ccclass('widget_base')
|
|
export class widget_base extends Component {
|
|
export class widget_base extends Component {
|
|
@@ -219,13 +221,18 @@ export class widget_base extends Component {
|
|
this.bindTarget.opacity = up_frame.transparent;
|
|
this.bindTarget.opacity = up_frame.transparent;
|
|
this.bindTarget.size = new Size(up_frame.size_width,up_frame.size_height)
|
|
this.bindTarget.size = new Size(up_frame.size_width,up_frame.size_height)
|
|
this.bindTarget.pos = new Vec3(up_frame.pos_x,up_frame.pos_y)
|
|
this.bindTarget.pos = new Vec3(up_frame.pos_x,up_frame.pos_y)
|
|
-
|
|
|
|
|
|
+ this.bindTarget.anchorPointX = up_frame.anchor_point_x
|
|
|
|
+ this.bindTarget.anchorPointY = up_frame.anchor_point_y
|
|
|
|
+
|
|
|
|
+ // anchorPointX:frame.anchor_point_x, anchorPointY:frame.anchor_point_y
|
|
|
|
+ console.log('anchorPointX=',frame.anchor_point_x,'anchorPointY=',frame.anchor_point_y)
|
|
let color_opactiy_tw_size = tween(this.bindTarget)
|
|
let color_opactiy_tw_size = tween(this.bindTarget)
|
|
- .to( tweenDuration, { pos:n_pos,color: _color,opacity:frame.transparent,size:new Size(frame.size_width,frame.size_height),rotation:frame.rotation }, {
|
|
|
|
|
|
+ .to( tweenDuration, { pos:n_pos,color: _color,opacity:frame.transparent,size:new Size(frame.size_width,frame.size_height),rotation:frame.rotation, anchorPointX:frame.anchor_point_x, anchorPointY:frame.anchor_point_y}, {
|
|
onUpdate(tar:BindTarget){
|
|
onUpdate(tar:BindTarget){
|
|
self.icon.getComponent(Sprite).color = tar.color;
|
|
self.icon.getComponent(Sprite).color = tar.color;
|
|
self.icon.getComponent(UIOpacity).opacity = tar.opacity;
|
|
self.icon.getComponent(UIOpacity).opacity = tar.opacity;
|
|
self.icon.getComponent(UITransform).setContentSize(tar.size)
|
|
self.icon.getComponent(UITransform).setContentSize(tar.size)
|
|
|
|
+ self.icon.getComponent(UITransform).setAnchorPoint(tar.anchorPointX, tar.anchorPointY)
|
|
if(self.mCurAnimation.isMove){
|
|
if(self.mCurAnimation.isMove){
|
|
self.node.position = tar.pos
|
|
self.node.position = tar.pos
|
|
}
|
|
}
|