future hace 1 año
padre
commit
2429c28f96

+ 21 - 21
assets/edit_game.scene

@@ -116,7 +116,7 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 960,
+      "x": 959.9999999999999,
       "y": 960,
       "z": 0
     },
@@ -206,8 +206,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1920,
-      "height": 1920
+      "width": 1919.9999999999998,
+      "height": 1919.9999999999998
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -344,7 +344,7 @@
     "_priority": 0,
     "_fov": 45,
     "_fovAxis": 0,
-    "_orthoHeight": 960,
+    "_orthoHeight": 959.9999999999999,
     "_near": 0,
     "_far": 1000,
     "_color": {
@@ -533,8 +533,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 840,
-      "height": 1920
+      "width": 839.9999999999997,
+      "height": 1919.9999999999998
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -7333,7 +7333,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": -510,
+      "y": -509.9999999999999,
       "z": 0
     },
     "_lrot": {
@@ -7390,7 +7390,7 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 420,
+      "x": 419.99999999999983,
       "y": 0,
       "z": 0
     },
@@ -7790,7 +7790,7 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 800,
+      "width": 799.9999999999997,
       "height": 860
     },
     "_anchorPoint": {
@@ -7908,7 +7908,7 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -285,
+      "x": -284.99999999999983,
       "y": -105,
       "z": 0
     },
@@ -8191,7 +8191,7 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 800,
+      "width": 799.9999999999997,
       "height": 210
     },
     "_anchorPoint": {
@@ -8275,7 +8275,7 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 840,
+      "width": 839.9999999999997,
       "height": 900
     },
     "_anchorPoint": {
@@ -16616,8 +16616,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 840,
-      "height": 1920
+      "width": 839.9999999999997,
+      "height": 1919.9999999999998
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -18508,7 +18508,7 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 750.1330000000002,
+      "x": 750.133,
       "y": 0,
       "z": 0
     },
@@ -172633,8 +172633,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 419.9999999999998,
-      "height": 1870
+      "width": 419.99999999999943,
+      "height": 1869.9999999999998
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -172858,8 +172858,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 419.9999999999998,
-      "height": 1920
+      "width": 419.99999999999943,
+      "height": 1919.9999999999998
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -175476,8 +175476,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1920,
-      "height": 1920
+      "width": 1919.9999999999998,
+      "height": 1919.9999999999998
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 6 - 1
assets/script/run/scene_page.ts

@@ -13,6 +13,8 @@ class BindTarget{
     size:Size;
     pos:Vec3;
     rotation:number;
+    anchorPointX:number;
+    anchorPointY:number;
 }
 @ccclass('scene_page')
 export class scene_page extends Component {
@@ -222,15 +224,18 @@ export class scene_page extends Component {
         this.bindTarget.opacity = up_frame.transparent;
         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.anchorPointX = up_frame.anchor_point_x
+        this.bindTarget.anchorPointY = up_frame.anchor_point_y
    
         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){
                 self.content.getComponent(Sprite).color = tar.color; 
                 self.content.getComponent(UIOpacity).opacity = tar.opacity;
                 // self.content.getComponent(UITransform).setContentSize(tar.size)
                 self.content.position = tar.pos
                 self.content.angle = tar.rotation;
+                self.content.getComponent(UITransform).setAnchorPoint(tar.anchorPointX, tar.anchorPointY)
             }
         }).call(()=>{
             call()

+ 1 - 1
assets/script/run/ui_layer.ts

@@ -164,7 +164,7 @@ export class ui_layer extends Component {
         if(this.mAttCountDown!=null){
             let att_count_down_data = this.mAttCountDown.getData()
             if(att_count_down_data.start_event_id===event_id){
-                tools.showToast("完成了所有的收集")
+                // tools.showToast("完成了所有的收集")
                 let finish_id = this.mAttCountDown.getData().finish_event_id;
                 if(finish_id!=-1){
                     gameManager.Singleton.exeEvent(finish_id)

+ 9 - 2
assets/script/run/widget/widget_base.ts

@@ -11,6 +11,8 @@ class BindTarget{
     size:Size;
     pos:Vec3;
     rotation:number;
+    anchorPointX:number;
+    anchorPointY:number;
 }
 @ccclass('widget_base')
 export class widget_base extends Component {
@@ -219,13 +221,18 @@ export class widget_base extends Component {
         this.bindTarget.opacity = up_frame.transparent;
         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.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)
-        .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){
                 self.icon.getComponent(Sprite).color = tar.color; 
                 self.icon.getComponent(UIOpacity).opacity = tar.opacity;
                 self.icon.getComponent(UITransform).setContentSize(tar.size)
+                self.icon.getComponent(UITransform).setAnchorPoint(tar.anchorPointX, tar.anchorPointY)
                 if(self.mCurAnimation.isMove){
                     self.node.position = tar.pos
                 }