future 11 mesiacov pred
rodič
commit
ee020740f8

+ 1 - 1
assets/resources/prefab/show_widget_list.prefab

@@ -904,7 +904,7 @@
     "_paddingTop": 0,
     "_paddingBottom": 0,
     "_spacingX": 50,
-    "_spacingY": 50,
+    "_spacingY": 70,
     "_verticalDirection": 1,
     "_horizontalDirection": 0,
     "_constraint": 2,

+ 11 - 11
assets/resources/prefab/widget_item.prefab

@@ -451,7 +451,7 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "Label",
+    "_name": "lab_name",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
@@ -473,7 +473,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 0,
+      "y": -117,
       "z": 0
     },
     "_lrot": {
@@ -514,7 +514,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 200,
-      "height": 37.8
+      "height": 30
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -552,10 +552,10 @@
     "_string": "点击控件",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
-    "_actualFontSize": 31,
-    "_fontSize": 30,
+    "_actualFontSize": 29,
+    "_fontSize": 28,
     "_fontFamily": "Arial",
-    "_lineHeight": 30,
+    "_lineHeight": 28,
     "_overflow": 2,
     "_enableWrapText": true,
     "_font": null,
@@ -2643,7 +2643,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": -54.64200000000005,
+      "y": -145,
       "z": 0
     },
     "_lrot": {
@@ -2684,7 +2684,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 200,
-      "height": 50.4
+      "height": 20
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -2722,17 +2722,17 @@
     "_string": "",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
-    "_actualFontSize": 21,
+    "_actualFontSize": 20,
     "_fontSize": 20,
     "_fontFamily": "Arial",
-    "_lineHeight": 40,
+    "_lineHeight": 20,
     "_overflow": 2,
     "_enableWrapText": true,
     "_font": null,
     "_isSystemFontUsed": true,
     "_spacingX": 0,
     "_isItalic": false,
-    "_isBold": true,
+    "_isBold": false,
     "_isUnderline": false,
     "_underlineHeight": 2,
     "_cacheMode": 0,

+ 1 - 0
assets/script/edit/cur_edit_scene.ts

@@ -46,6 +46,7 @@ export class cur_edit_scene extends Component {
                 }
                 if(container_id==-1){
                     page.getComponent(scroll_scene).addWidget(node)
+                    setTimeout(()=>{node.getComponent(widget_item).initWidgetAddCurEditSecne()},50)
                 }else{
                     node.position = new Vec3(0,0);
                     page.getComponent(scroll_scene).addContainer(container_id,node)

+ 11 - 1
assets/script/edit/widget_item.ts

@@ -49,6 +49,16 @@ export class widget_item extends Component {
             this.m_delete_cb && this.m_delete_cb(this)
         })
     }
+
+    public initWidgetAddCurEditSecne() {
+        this.lab_name.setPosition(this.lab_name.getPosition().x,-117,0)
+        this.lab_name.getComponent(Label).string = this.m_data.name + (this.m_data.att?`id:${this.m_data.att.id}`:"");
+    }
+
+    public initWidgetType() {
+        this.lab_name.setPosition(0,0,0)
+    }
+
     public hideContainerChilden(){
         this.m_isShowContainerChilden = false
     }
@@ -433,7 +443,7 @@ export class widget_item extends Component {
                     }else{
                         assetManager.loadRemote<ImageAsset>(this.m_att.src, (err, imageAsset2)=>{
                             if (!err && imageAsset2) {        
-                                this.lab_name.active = false;
+                                // this.lab_name.active = false;
                                 const texture = new Texture2D();
                                 texture.image = imageAsset2;
                                 let spFrame2 = new SpriteFrame();     

+ 1 - 0
assets/script/edit/widget_list.ts

@@ -15,6 +15,7 @@ export class widget_list extends Component {
         config.Widget_Type.forEach((v,k)=>{
             let item:Node = instantiate(this.item_prefab)
             item.parent = this.node.getComponent(ScrollView).content
+            item.getComponent(widget_item).initWidgetType()
             item.getComponent(widget_item).initView(v)
         })
     }