Bladeren bron

登录,进度条,公告

zouyong 5 jaren geleden
bovenliggende
commit
57b50197e4

+ 11 - 11
assets/resources/game/prefab/cast.prefab

@@ -113,7 +113,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 501,
+      "width": 420,
       "height": 38
     },
     "_anchorPoint": {
@@ -169,7 +169,7 @@
       "__uuid__": "e7f21add-0901-45f9-ba08-7bef0c31b0bb"
     },
     "_type": 0,
-    "_sizeMode": 1,
+    "_sizeMode": 0,
     "_fillType": 0,
     "_fillCenter": {
       "__type__": "cc.Vec2",
@@ -224,7 +224,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 500,
+      "width": 336,
       "height": 38
     },
     "_anchorPoint": {
@@ -292,7 +292,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 378.22,
+      "width": 324.19,
       "height": 37.8
     },
     "_anchorPoint": {
@@ -356,7 +356,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 378.22,
+      "width": 324.19,
       "height": 37.8
     },
     "_anchorPoint": {
@@ -368,7 +368,7 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        -189.11,
+        -162.095,
         -18.9,
         0,
         0,
@@ -411,7 +411,7 @@
     "_dstBlendFactor": 771,
     "_string": "留的住我不要成功提现了100元",
     "_N$string": "留的住我不要成功提现了100元",
-    "_fontSize": 28,
+    "_fontSize": 24,
     "_lineHeight": 30,
     "_enableWrapText": true,
     "_N$file": {
@@ -437,7 +437,7 @@
     "asset": {
       "__uuid__": "43c489d3-8e64-48bd-aa3b-abddeb2d3dca"
     },
-    "fileId": "e4vc2UhdpO+rBp0PktnQ1H",
+    "fileId": "96KOeT2fdCt7hX8hMvMG1+",
     "sync": false
   },
   {
@@ -452,7 +452,7 @@
     "_isSystemFontUsed": false,
     "_N$string": "<color=#00ff00>留的住我不要成功提现了100元</color>",
     "_N$horizontalAlign": 0,
-    "_N$fontSize": 28,
+    "_N$fontSize": 24,
     "_N$font": {
       "__uuid__": "0bc2f1e8-1dd4-45ba-8f7e-36c47dde4152"
     },
@@ -544,7 +544,7 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        -205,
+        -185,
         0,
         0,
         0,
@@ -651,7 +651,7 @@
       "__id__": 10
     },
     "display_time": 5,
-    "move_speed": 3,
+    "move_speed": 2,
     "wait_time": 10,
     "_id": ""
   },

+ 157 - 63
assets/resources/module/login/login.prefab

@@ -30,20 +30,20 @@
         "__id__": 11
       },
       {
-        "__id__": 20
+        "__id__": 23
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 35
+        "__id__": 38
       },
       {
-        "__id__": 36
+        "__id__": 39
       }
     ],
     "_prefab": {
-      "__id__": 37
+      "__id__": 40
     },
     "_opacity": 255,
     "_color": {
@@ -432,11 +432,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 18
+        "__id__": 21
       }
     ],
     "_prefab": {
-      "__id__": 19
+      "__id__": 22
     },
     "_opacity": 255,
     "_color": {
@@ -599,15 +599,19 @@
     "_parent": {
       "__id__": 11
     },
-    "_children": [],
+    "_children": [
+      {
+        "__id__": 16
+      }
+    ],
     "_active": true,
     "_components": [
       {
-        "__id__": 16
+        "__id__": 19
       }
     ],
     "_prefab": {
-      "__id__": 17
+      "__id__": 20
     },
     "_opacity": 255,
     "_color": {
@@ -657,11 +661,75 @@
     "_id": ""
   },
   {
+    "__type__": "cc.Node",
+    "_name": "jindu2",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 15
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 17
+      }
+    ],
+    "_prefab": {
+      "__id__": 18
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 509,
+      "height": 31
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
     "__type__": "cc.Sprite",
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 15
+      "__id__": 16
     },
     "_enabled": true,
     "_materials": [
@@ -696,6 +764,39 @@
     "asset": {
       "__uuid__": "484d8a70-97b2-4ddd-9794-87ef1c8b85d8"
     },
+    "fileId": "0ez/dzBMNKNax+cLKaYMD8",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Mask",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 15
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_spriteFrame": {
+      "__uuid__": "12f6c46a-9ff5-4514-89a6-fc34c6bfedfc"
+    },
+    "_type": 2,
+    "_segments": 64,
+    "_N$alphaThreshold": 0.1,
+    "_N$inverted": false,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 11
+    },
+    "asset": {
+      "__uuid__": "484d8a70-97b2-4ddd-9794-87ef1c8b85d8"
+    },
     "fileId": "10LZ8FBrhFcJeTefqRoH+s",
     "sync": false
   },
@@ -707,13 +808,9 @@
       "__id__": 11
     },
     "_enabled": true,
-    "blood_1": {
-      "__id__": 13
-    },
-    "blood_2": {
-      "__id__": 16
+    "bar": {
+      "__id__": 17
     },
-    "lbl_progress": null,
     "_id": ""
   },
   {
@@ -724,7 +821,7 @@
     "asset": {
       "__uuid__": "484d8a70-97b2-4ddd-9794-87ef1c8b85d8"
     },
-    "fileId": "ccD6DpeihB844U1i615DT4",
+    "fileId": "e2Kok419pI77OJ0gMBTris",
     "sync": false
   },
   {
@@ -736,9 +833,6 @@
     },
     "_children": [
       {
-        "__id__": 21
-      },
-      {
         "__id__": 24
       },
       {
@@ -746,16 +840,19 @@
       },
       {
         "__id__": 30
+      },
+      {
+        "__id__": 33
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 33
+        "__id__": 36
       }
     ],
     "_prefab": {
-      "__id__": 34
+      "__id__": 37
     },
     "_opacity": 255,
     "_color": {
@@ -767,7 +864,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 500,
+      "width": 460,
       "height": 50
     },
     "_anchorPoint": {
@@ -809,19 +906,19 @@
     "_name": "New Label",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 20
+      "__id__": 23
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 22
+        "__id__": 25
       }
     ],
     "_prefab": {
-      "__id__": 23
+      "__id__": 26
     },
-    "_opacity": 255,
+    "_opacity": 200,
     "_color": {
       "__type__": "cc.Color",
       "r": 237,
@@ -831,7 +928,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 140,
+      "width": 130,
       "height": 37.8
     },
     "_anchorPoint": {
@@ -843,7 +940,7 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        -180,
+        -165,
         6.246,
         0,
         0,
@@ -873,7 +970,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 21
+      "__id__": 24
     },
     "_enabled": true,
     "_materials": [
@@ -885,7 +982,7 @@
     "_dstBlendFactor": 771,
     "_string": "登陆即同意",
     "_N$string": "登陆即同意",
-    "_fontSize": 28,
+    "_fontSize": 26,
     "_lineHeight": 30,
     "_enableWrapText": true,
     "_N$file": null,
@@ -917,19 +1014,19 @@
     "_name": "New Label",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 20
+      "__id__": 23
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 25
+        "__id__": 28
       }
     ],
     "_prefab": {
-      "__id__": 26
+      "__id__": 29
     },
-    "_opacity": 255,
+    "_opacity": 200,
     "_color": {
       "__type__": "cc.Color",
       "r": 237,
@@ -939,7 +1036,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 168,
+      "width": 156,
       "height": 37.8
     },
     "_anchorPoint": {
@@ -951,7 +1048,7 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        -26,
+        -22,
         6.246,
         0,
         0,
@@ -981,7 +1078,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 24
+      "__id__": 27
     },
     "_enabled": true,
     "_materials": [
@@ -993,7 +1090,7 @@
     "_dstBlendFactor": 771,
     "_string": "《服务协议》",
     "_N$string": "《服务协议》",
-    "_fontSize": 28,
+    "_fontSize": 26,
     "_lineHeight": 30,
     "_enableWrapText": true,
     "_N$file": null,
@@ -1025,19 +1122,19 @@
     "_name": "New Label",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 20
+      "__id__": 23
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 28
+        "__id__": 31
       }
     ],
     "_prefab": {
-      "__id__": 29
+      "__id__": 32
     },
-    "_opacity": 255,
+    "_opacity": 200,
     "_color": {
       "__type__": "cc.Color",
       "r": 237,
@@ -1047,7 +1144,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 28,
+      "width": 26,
       "height": 37.8
     },
     "_anchorPoint": {
@@ -1059,7 +1156,7 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        72,
+        69,
         6.246,
         0,
         0,
@@ -1089,7 +1186,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 27
+      "__id__": 30
     },
     "_enabled": true,
     "_materials": [
@@ -1101,7 +1198,7 @@
     "_dstBlendFactor": 771,
     "_string": "和",
     "_N$string": "和",
-    "_fontSize": 28,
+    "_fontSize": 26,
     "_lineHeight": 30,
     "_enableWrapText": true,
     "_N$file": null,
@@ -1133,19 +1230,19 @@
     "_name": "New Label",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 20
+      "__id__": 23
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 31
+        "__id__": 34
       }
     ],
     "_prefab": {
-      "__id__": 32
+      "__id__": 35
     },
-    "_opacity": 255,
+    "_opacity": 200,
     "_color": {
       "__type__": "cc.Color",
       "r": 237,
@@ -1155,7 +1252,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 168,
+      "width": 156,
       "height": 37.8
     },
     "_anchorPoint": {
@@ -1167,7 +1264,7 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        170,
+        160,
         6.246,
         0,
         0,
@@ -1197,7 +1294,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 30
+      "__id__": 33
     },
     "_enabled": true,
     "_materials": [
@@ -1209,7 +1306,7 @@
     "_dstBlendFactor": 771,
     "_string": "《隐私条款》",
     "_N$string": "《隐私条款》",
-    "_fontSize": 28,
+    "_fontSize": 26,
     "_lineHeight": 30,
     "_enableWrapText": true,
     "_N$file": null,
@@ -1241,12 +1338,12 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 20
+      "__id__": 23
     },
     "_enabled": true,
     "_layoutSize": {
       "__type__": "cc.Size",
-      "width": 500,
+      "width": 460,
       "height": 50
     },
     "_resize": 0,
@@ -1287,20 +1384,17 @@
       "__id__": 1
     },
     "_enabled": true,
-    "sf_redbag": {
-      "__uuid__": "65b80c28-2013-4912-86ba-d15acd071545"
-    },
     "bar": {
-      "__id__": 18
+      "__id__": 21
     },
     "lbl_progress": {
       "__id__": 9
     },
     "lbl_server": {
-      "__id__": 25
+      "__id__": 28
     },
     "lbl_privacy": {
-      "__id__": 31
+      "__id__": 34
     },
     "_id": ""
   },

+ 110 - 13
assets/resources/module/login/progressbar.prefab

@@ -27,11 +27,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 8
+        "__id__": 11
       }
     ],
     "_prefab": {
-      "__id__": 9
+      "__id__": 12
     },
     "_opacity": 255,
     "_color": {
@@ -56,7 +56,7 @@
       "ctor": "Float64Array",
       "array": [
         0,
-        0,
+        -400,
         0,
         0,
         0,
@@ -194,15 +194,19 @@
     "_parent": {
       "__id__": 1
     },
-    "_children": [],
+    "_children": [
+      {
+        "__id__": 6
+      }
+    ],
     "_active": true,
     "_components": [
       {
-        "__id__": 6
+        "__id__": 9
       }
     ],
     "_prefab": {
-      "__id__": 7
+      "__id__": 10
     },
     "_opacity": 255,
     "_color": {
@@ -252,11 +256,75 @@
     "_id": ""
   },
   {
+    "__type__": "cc.Node",
+    "_name": "jindu2",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 5
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 7
+      }
+    ],
+    "_prefab": {
+      "__id__": 8
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 509,
+      "height": 31
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
     "__type__": "cc.Sprite",
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 5
+      "__id__": 6
     },
     "_enabled": true,
     "_materials": [
@@ -291,6 +359,39 @@
     "asset": {
       "__uuid__": "484d8a70-97b2-4ddd-9794-87ef1c8b85d8"
     },
+    "fileId": "0ez/dzBMNKNax+cLKaYMD8",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Mask",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 5
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_spriteFrame": {
+      "__uuid__": "12f6c46a-9ff5-4514-89a6-fc34c6bfedfc"
+    },
+    "_type": 2,
+    "_segments": 64,
+    "_N$alphaThreshold": 0.1,
+    "_N$inverted": false,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "484d8a70-97b2-4ddd-9794-87ef1c8b85d8"
+    },
     "fileId": "10LZ8FBrhFcJeTefqRoH+s",
     "sync": false
   },
@@ -302,13 +403,9 @@
       "__id__": 1
     },
     "_enabled": true,
-    "blood_1": {
-      "__id__": 3
-    },
-    "blood_2": {
-      "__id__": 6
+    "bar": {
+      "__id__": 7
     },
-    "lbl_progress": null,
     "_id": ""
   },
   {

+ 7 - 39
assets/script/game/component/ProgressBar.ts

@@ -2,49 +2,17 @@ const { ccclass, property } = cc._decorator;
 
 @ccclass
 export default class ProgressBar extends cc.Component {
-    @property({ type: cc.Sprite, displayName: '进度条背景' })
-    blood_1: cc.Sprite = null;
+    @property({ type: cc.Sprite, displayName: '进度条' })
+    bar: cc.Sprite = null;
 
-    @property({ type: cc.Sprite, displayName: '进度条动画节点' })
-    blood_2: cc.Sprite = null;
-
-    @property(cc.Label)
-    lbl_progress: cc.Label = null;
-
-    private maxlen: number;
-    private current: number;
-    private max: number;
-    private tweenSpeed: number = 100;
+    private len: number;
 
     onLoad() {
-        this.maxlen = this.blood_1.node.width;
-    }
-
-    init(current, max) {
-        this.current = current;
-        this.max = max;
-        this.blood_2.node.width = this.maxlen;
-        this.updateLabel();
-    }
-
-    setProgress(current, tween: boolean = false) {
-        let dis = (this.current - current) * this.maxlen / this.max;
-        this.current = current;
-        let w = current / this.max * this.maxlen;
-        if (tween) {
-            let t = dis / this.tweenSpeed;
-            cc.tween(this.blood_2.node).to(t, { width: w }).start();
-        }
-        else {
-            this.blood_2.node.width = w;
-        }
-
-        this.updateLabel();
+        this.len = this.bar.node.width;
+        this.bar.node.x = -this.len;
     }
 
-    updateLabel() {
-        if (this.lbl_progress) {
-            this.lbl_progress.string = Math.floor(this.current) + "/" + Math.floor(this.max);
-        }
+    setProgress(current) {
+        this.bar.node.x = -this.len + (current / 100 * this.len);
     }
 }

+ 3 - 3
assets/script/game/component/tween/TweenCast.ts

@@ -49,15 +49,15 @@ export default class TweenCast extends cc.Component {
     private rickPlay() {
         this.node.active = true;
         cc.tween(this.rich_text.node)
-            .to(this.move_speed, { x: 0 })
+            .to(this.move_speed, { x: 16 })
             .delay(this.display_time)
-            .to(this.move_speed, { x: -500 })
+            .to(this.move_speed, { x: -450 })
             .call(this.play.bind(this)).start();
     }
 
     private reset() {
         this.node.active = false;
-        this.rich_text.node.x = 500;
+        this.rich_text.node.x = 450;
         this.rich_text.string = this.getContent();
     }
 }

+ 6 - 19
assets/script/game/module/login/Login.ts

@@ -5,8 +5,6 @@ const { ccclass, property } = cc._decorator;
 @ccclass
 export default class Login extends cc.Component {
 
-    @property({ displayName: 'lbl毛币数量', type: cc.SpriteFrame })
-    private sf_redbag: cc.SpriteFrame = null;
     @property(ProgressBar)
     private bar: ProgressBar;
     @property({ displayName: '加载文字', type: cc.Label })
@@ -17,38 +15,27 @@ export default class Login extends cc.Component {
     private lbl_privacy: cc.Label = null;
 
     onLoad() {
-        this.setProgress(0, 100);
+        this.setProgress(0);
     }
 
     start() {
-        let start_node_pos = new cc.Vec2(0, -500)
-        let end_node_pos = new cc.Vec2(0, 500)
-        let fly_data = {
-            node_p: this.node,
-            item_count: 10,
-            item_scale: [1, 2],
-            item_sf: this.sf_redbag,
-            start_pos: start_node_pos,
-            end_pos: end_node_pos,
-            complete_call: () => {
-            },
-        }
-        this.node.emit('ui-fly-node', fly_data)
     }
 
     private setProgress(current) {
-        this.bar.init(current, 100);
+        this.bar.setProgress(current);
         this.lbl_progress.string = "加载不消耗流量 " + current + "%";
     }
 
+    private c: number = 0;
     update() {
+        if (this.c < 100) {
+            this.setProgress(++this.c);
+        }
         if (!gData.loginData.loadResCompelete) {
-            this.setProgress(10);
             gData.loginData.loadLocalRes();
             return;
         }
         if (!gData.loginData.isLogin) {
-            this.setProgress(60);
             gData.loginData.login();
             return;
         }