zouyong %!s(int64=5) %!d(string=hai) anos
pai
achega
de58741d22

+ 41 - 20
assets/resources/game/prefab/tips.prefab

@@ -27,14 +27,14 @@
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 8
+      "__id__": 9
     },
     "_opacity": 255,
     "_color": {
       "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
+      "r": 249,
+      "g": 247,
+      "b": 247,
       "a": 255
     },
     "_contentSize": {
@@ -93,18 +93,18 @@
     "_prefab": {
       "__id__": 4
     },
-    "_opacity": 20,
+    "_opacity": 255,
     "_color": {
       "__type__": "cc.Color",
-      "r": 227,
-      "g": 227,
-      "b": 227,
+      "r": 77,
+      "g": 80,
+      "b": 215,
       "a": 255
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 200,
-      "height": 80
+      "width": 300,
+      "height": 52
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -195,23 +195,26 @@
     "_components": [
       {
         "__id__": 6
+      },
+      {
+        "__id__": 7
       }
     ],
     "_prefab": {
-      "__id__": 7
+      "__id__": 8
     },
     "_opacity": 255,
     "_color": {
       "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
+      "r": 227,
+      "g": 218,
+      "b": 80,
       "a": 255
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 97.87,
-      "height": 50.4
+      "width": 258,
+      "height": 42.32
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -262,10 +265,10 @@
     ],
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
-    "_string": "Label",
-    "_N$string": "Label",
-    "_fontSize": 40,
-    "_lineHeight": 40,
+    "_string": "按时发放按时发放",
+    "_N$string": "按时发放按时发放",
+    "_fontSize": 32,
+    "_lineHeight": 32,
     "_enableWrapText": true,
     "_N$file": null,
     "_isSystemFontUsed": true,
@@ -281,6 +284,24 @@
     "_id": ""
   },
   {
+    "__type__": "cc.LabelOutline",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 5
+    },
+    "_enabled": true,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_width": 1,
+    "_id": ""
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1

+ 13 - 13
assets/scene/MainScene.fire

@@ -403,8 +403,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 0,
-      "height": 0
+      "width": 750,
+      "height": 1334
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -448,27 +448,27 @@
       "__id__": 8
     },
     "_enabled": true,
-    "tween_time": 3,
+    "tween_time": 1,
     "src_x": 0,
     "src_y": 0,
     "tar_x": 0,
-    "tar_y": 100,
-    "bg_opacity": 255,
+    "tar_y": 200,
+    "bg_opacity": 100,
     "bg_color": {
       "__type__": "cc.Color",
-      "r": 200,
-      "g": 200,
-      "b": 200,
-      "a": 255
+      "r": 36,
+      "g": 47,
+      "b": 232,
+      "a": 82
     },
     "tip_color": {
       "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
+      "r": 220,
+      "g": 220,
+      "b": 80,
       "a": 255
     },
-    "tip_size": 40,
+    "tip_size": 32,
     "_id": "41Yz88THFLQYf9GACa9dX1"
   },
   {

+ 0 - 1
assets/script/game/module/module/turntable/Turnable.ts

@@ -19,7 +19,6 @@ export default class Turnable extends cc.Component {
 
     onLoad() {
         this.initData();
-        mk.tip.pop("dafdfafsafdasf");
     }
 
     /**

+ 24 - 13
assets/script/mk/system/TipSystem.ts

@@ -7,7 +7,7 @@ const { ccclass, property } = cc._decorator;
  */
 export default class TipSystem extends cc.Component {
     @property({ type: cc.Integer, displayName: "飘动时间" })
-    tween_time: number = 3;
+    tween_time: number = 1;
     @property({ type: cc.Integer, displayName: "开始坐标x" })
     src_x: number = 0;
     @property({ type: cc.Integer, displayName: "开始坐标y" })
@@ -15,7 +15,7 @@ export default class TipSystem extends cc.Component {
     @property({ type: cc.Integer, displayName: "目标坐标x" })
     tar_x: number = 0;
     @property({ type: cc.Integer, displayName: "目标坐标y" })
-    tar_y: number = 100;
+    tar_y: number = 200;
     @property({ type: cc.Integer, displayName: "背景透明度" })
     bg_opacity: number = 40;
     @property({ displayName: "背景颜色" })
@@ -25,31 +25,42 @@ export default class TipSystem extends cc.Component {
     @property({ type: cc.Integer, displayName: "文本字体" })
     tip_size: number = 40;
 
-    private labels: cc.Label[];
-
     onLoad() {
         mk.tip = this;
-        this.labels = [];
     }
 
     start() {
 
     }
 
+    /**
+     * 弹出tips
+     * @param str 
+     */
     public async pop(str: string) {
         let node = await mk.pool.getPrefab("game/prefab/tips");
         let node_bg = node.getChildByName("bg");
         let node_lbl = node.getChildByName("lbl");
-        let bg = node_bg.getComponent(cc.Sprite);
         let lbl = node_lbl.getComponent(cc.Label);
-        node_bg.opacity = this.bg_opacity;
-        // node_bg.color = 
+        // node_bg.color = this.bg_color;
+        // node_bg.opacity = this.bg_opacity;
+        // node_lbl.color = this.tip_color;
+        lbl.fontSize = this.tip_size;
+        lbl.string = str;
+        node_bg.width = node_lbl.width + 20 < 200 ? 200 : node_lbl.width + 20;
+        node.width = node_bg.width;
+        node_bg.height = node_lbl.height + 2;
+        node.parent = this.node;
+        node.x = this.src_x;
+        node.y = this.src_y;
+        cc.tween(node)
+            .to(this.tween_time, { x: this.tar_x, y: this.tar_y })
+            .call(() => {
+                node.destroy();
+                mk.pool.return("tips", node);
+            }, this)
+            .start();
     }
 
 
-}
-
-
-export enum TipType {
-    label = 1,
 }