future 1 gadu atpakaļ
vecāks
revīzija
d1be9b77c4

+ 4 - 4
assets/resources/prefab/run/level_list_item.prefab

@@ -105,7 +105,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": -11,
-      "y": 204,
+      "y": 210,
       "z": 0
     },
     "_lrot": {
@@ -145,8 +145,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 234,
-      "height": 77
+      "width": 239,
+      "height": 67
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -182,7 +182,7 @@
       "a": 255
     },
     "_spriteFrame": {
-      "__uuid__": "473f758a-63ad-4181-aa7a-e60a463f0c1e@f9941",
+      "__uuid__": "e9e42b87-8545-492d-919b-68ebefc071c4@f9941",
       "__expectedType__": "cc.SpriteFrame"
     },
     "_type": 0,

+ 8 - 8
assets/resources/prefab/run/task/shouji_item.prefab

@@ -270,8 +270,8 @@
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0.43599999999999284,
+      "x": -2,
+      "y": 3.435999999999993,
       "z": 0
     },
     "_lrot": {
@@ -311,8 +311,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 190,
-      "height": 140
+      "width": 180,
+      "height": 128
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -384,10 +384,10 @@
     },
     "_alignFlags": 45,
     "_target": null,
-    "_left": 13,
-    "_right": 13,
-    "_top": 12.064000000000004,
-    "_bottom": 12.935999999999996,
+    "_left": 16,
+    "_right": 20,
+    "_top": 15.064000000000007,
+    "_bottom": 21.935999999999993,
     "_horizontalCenter": 0,
     "_verticalCenter": 0,
     "_isAbsLeft": true,

BIN
assets/run/game_list/huai_jiu.png


+ 20 - 20
assets/run/game_list/huai_jiu.png.meta

@@ -46,10 +46,10 @@
         "offsetY": 0,
         "trimX": 0,
         "trimY": 0,
-        "width": 234,
-        "height": 77,
-        "rawWidth": 234,
-        "rawHeight": 77,
+        "width": 239,
+        "height": 67,
+        "rawWidth": 239,
+        "rawHeight": 67,
         "borderTop": 0,
         "borderBottom": 0,
         "borderLeft": 0,
@@ -61,17 +61,17 @@
         "meshType": 0,
         "vertices": {
           "rawPosition": [
-            -117,
-            -38.5,
+            -119.5,
+            -33.5,
             0,
-            117,
-            -38.5,
+            119.5,
+            -33.5,
             0,
-            -117,
-            38.5,
+            -119.5,
+            33.5,
             0,
-            117,
-            38.5,
+            119.5,
+            33.5,
             0
           ],
           "indexes": [
@@ -84,12 +84,12 @@
           ],
           "uv": [
             0,
-            77,
-            234,
-            77,
+            67,
+            239,
+            67,
             0,
             0,
-            234,
+            239,
             0
           ],
           "nuv": [
@@ -103,13 +103,13 @@
             1
           ],
           "minPos": [
-            -117,
-            -38.5,
+            -119.5,
+            -33.5,
             0
           ],
           "maxPos": [
-            117,
-            38.5,
+            119.5,
+            33.5,
             0
           ]
         },

BIN
assets/run/game_list/ju_qing.png


+ 24 - 24
assets/run/game_list/ju_qing.png.meta

@@ -43,13 +43,13 @@
         "trimThreshold": 1,
         "rotated": false,
         "offsetX": 0,
-        "offsetY": -0.5,
+        "offsetY": 0,
         "trimX": 0,
-        "trimY": 1,
-        "width": 234,
-        "height": 77,
-        "rawWidth": 234,
-        "rawHeight": 78,
+        "trimY": 0,
+        "width": 239,
+        "height": 67,
+        "rawWidth": 239,
+        "rawHeight": 67,
         "borderTop": 0,
         "borderBottom": 0,
         "borderLeft": 0,
@@ -61,17 +61,17 @@
         "meshType": 0,
         "vertices": {
           "rawPosition": [
-            -117,
-            -38.5,
+            -119.5,
+            -33.5,
             0,
-            117,
-            -38.5,
+            119.5,
+            -33.5,
             0,
-            -117,
-            38.5,
+            -119.5,
+            33.5,
             0,
-            117,
-            38.5,
+            119.5,
+            33.5,
             0
           ],
           "indexes": [
@@ -84,12 +84,12 @@
           ],
           "uv": [
             0,
-            77,
-            234,
-            77,
+            67,
+            239,
+            67,
             0,
             0,
-            234,
+            239,
             0
           ],
           "nuv": [
@@ -98,18 +98,18 @@
             1,
             0,
             0,
-            0.9871794871794872,
             1,
-            0.9871794871794872
+            1,
+            1
           ],
           "minPos": [
-            -117,
-            -38.5,
+            -119.5,
+            -33.5,
             0
           ],
           "maxPos": [
-            117,
-            38.5,
+            119.5,
+            33.5,
             0
           ]
         },

BIN
assets/run/game_list/kong_bu.png


+ 22 - 22
assets/run/game_list/kong_bu.png.meta

@@ -46,10 +46,10 @@
         "offsetY": -0.5,
         "trimX": 0,
         "trimY": 1,
-        "width": 234,
-        "height": 77,
-        "rawWidth": 234,
-        "rawHeight": 78,
+        "width": 239,
+        "height": 66,
+        "rawWidth": 239,
+        "rawHeight": 67,
         "borderTop": 0,
         "borderBottom": 0,
         "borderLeft": 0,
@@ -61,17 +61,17 @@
         "meshType": 0,
         "vertices": {
           "rawPosition": [
-            -117,
-            -38.5,
+            -119.5,
+            -33,
             0,
-            117,
-            -38.5,
+            119.5,
+            -33,
             0,
-            -117,
-            38.5,
+            -119.5,
+            33,
             0,
-            117,
-            38.5,
+            119.5,
+            33,
             0
           ],
           "indexes": [
@@ -84,12 +84,12 @@
           ],
           "uv": [
             0,
-            77,
-            234,
-            77,
+            66,
+            239,
+            66,
             0,
             0,
-            234,
+            239,
             0
           ],
           "nuv": [
@@ -98,18 +98,18 @@
             1,
             0,
             0,
-            0.9871794871794872,
+            0.9850746268656716,
             1,
-            0.9871794871794872
+            0.9850746268656716
           ],
           "minPos": [
-            -117,
-            -38.5,
+            -119.5,
+            -33,
             0
           ],
           "maxPos": [
-            117,
-            38.5,
+            119.5,
+            33,
             0
           ]
         },

BIN
assets/run/game_list/nao_dong.png


+ 20 - 20
assets/run/game_list/nao_dong.png.meta

@@ -46,10 +46,10 @@
         "offsetY": 0,
         "trimX": 0,
         "trimY": 0,
-        "width": 234,
-        "height": 78,
-        "rawWidth": 234,
-        "rawHeight": 78,
+        "width": 239,
+        "height": 67,
+        "rawWidth": 239,
+        "rawHeight": 67,
         "borderTop": 0,
         "borderBottom": 0,
         "borderLeft": 0,
@@ -61,17 +61,17 @@
         "meshType": 0,
         "vertices": {
           "rawPosition": [
-            -117,
-            -39,
+            -119.5,
+            -33.5,
             0,
-            117,
-            -39,
+            119.5,
+            -33.5,
             0,
-            -117,
-            39,
+            -119.5,
+            33.5,
             0,
-            117,
-            39,
+            119.5,
+            33.5,
             0
           ],
           "indexes": [
@@ -84,12 +84,12 @@
           ],
           "uv": [
             0,
-            78,
-            234,
-            78,
+            67,
+            239,
+            67,
             0,
             0,
-            234,
+            239,
             0
           ],
           "nuv": [
@@ -103,13 +103,13 @@
             1
           ],
           "minPos": [
-            -117,
-            -39,
+            -119.5,
+            -33.5,
             0
           ],
           "maxPos": [
-            117,
-            39,
+            119.5,
+            33.5,
             0
           ]
         },

BIN
assets/run/game_list/tui_li.png


+ 20 - 20
assets/run/game_list/tui_li.png.meta

@@ -46,10 +46,10 @@
         "offsetY": 0,
         "trimX": 0,
         "trimY": 0,
-        "width": 234,
-        "height": 77,
-        "rawWidth": 234,
-        "rawHeight": 77,
+        "width": 239,
+        "height": 67,
+        "rawWidth": 239,
+        "rawHeight": 67,
         "borderTop": 0,
         "borderBottom": 0,
         "borderLeft": 0,
@@ -61,17 +61,17 @@
         "meshType": 0,
         "vertices": {
           "rawPosition": [
-            -117,
-            -38.5,
+            -119.5,
+            -33.5,
             0,
-            117,
-            -38.5,
+            119.5,
+            -33.5,
             0,
-            -117,
-            38.5,
+            -119.5,
+            33.5,
             0,
-            117,
-            38.5,
+            119.5,
+            33.5,
             0
           ],
           "indexes": [
@@ -84,12 +84,12 @@
           ],
           "uv": [
             0,
-            77,
-            234,
-            77,
+            67,
+            239,
+            67,
             0,
             0,
-            234,
+            239,
             0
           ],
           "nuv": [
@@ -103,13 +103,13 @@
             1
           ],
           "minPos": [
-            -117,
-            -38.5,
+            -119.5,
+            -33.5,
             0
           ],
           "maxPos": [
-            117,
-            38.5,
+            119.5,
+            33.5,
             0
           ]
         },

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 178 - 145
assets/scene/game.scene


+ 41 - 38
assets/script/run/game_list_view/game_list.ts

@@ -1,4 +1,4 @@
-import { _decorator, Component, EventTouch, instantiate, JsonAsset, Label, Layout, Node, Prefab, ScrollView, Sprite, sys, UITransform, Vec2, Vec3 } from 'cc';
+import { _decorator, Component, EventTouch, instantiate, JsonAsset, Label, Layout, Node, Prefab, ScrollView, Size, Sprite, sys, UITransform, Vec2, Vec3 } from 'cc';
 import { http } from '../../http';
 import { gameManager } from '../gameManager';
 import { LevelInfoMessage, LevelItemData, LevelMessage, scene_item_data } from '../../../data/data';
@@ -74,12 +74,13 @@ export class game_list extends Component {
 
         let layout = this.content.getComponent(Layout)
         let item = instantiate(this.game_level_item)
-        let widget_height = (item.getComponent(UITransform).height*3 + layout.spacingY*2)
-        let padding_top = (this.content.getComponent(UITransform).height - widget_height) / 2
-        layout.paddingTop = padding_top
+        let widget_height = item.getComponent(UITransform).height*3
+        let padding_y = (this.content.getComponent(UITransform).height - widget_height) / 4
+        layout.paddingTop = padding_y
+        layout.spacingY = padding_y
 
         let item_spacing_x = (this.content.getComponent(UITransform).width - item.getComponent(UITransform).width*2) / 3
-        layout.paddingLeft = item_spacing_x - 20
+        layout.paddingLeft = item_spacing_x
         layout.spacingX = item_spacing_x
     }
 
@@ -105,38 +106,7 @@ export class game_list extends Component {
             this.start_pos = et.getUILocation()
         })
         this.content.on(Node.EventType.TOUCH_MOVE,(et:EventTouch)=>{
-            // console.log('select_page=',gameManager.getStaticUserData().select_page)
-            // if(gameManager.getStaticUserData().select_page ==1) {
-            //     return
-            // }
-            this.onTouchActive = false
-            if( Math.abs(this.start_pos.x-et.getUILocation().x)<30){
-                this.start_pos = et.getUILocation()
-                this.onTouchActive = true
-                return
-            }
-            let p = new Vec3(et.getUILocation().x,et.getUILocation().y)
-            let n_p = this.content.parent.getComponent(UITransform).convertToNodeSpaceAR(p)
-            let pos = this.content.parent.getComponent(UITransform).convertToWorldSpaceAR(this.content.position)
-            if(this.x_len==0){
-                this.x_len = (et.getUILocation().x - pos.x)*1;
-            }
-            let content_position_x = n_p.x-this.x_len
-            console.log('content_position_x=',content_position_x)
-            this.content.position = new Vec3(content_position_x,this.content.position.y);
-            // this.onTouchActive = false
-            // if( Math.abs(this.start_pos.x-et.getUILocation().x)<30){
-            //     this.start_pos = et.getUILocation()
-            //     this.onTouchActive = true
-            //     return
-            // }
-            // let p = new Vec3(et.getUILocation().x,et.getUILocation().y)
-            // let n_p = this.content.parent.getComponent(UITransform).convertToNodeSpaceAR(p)
-            // let pos = this.content.parent.getComponent(UITransform).convertToWorldSpaceAR(this.content.position)
-            // if(this.x_len==0){
-            //     this.x_len = (et.getUILocation().x - pos.x)*1;
-            // }
-            // this.content.position = new Vec3(n_p.x-this.x_len ,this.content.position.y);
+            this.touchContentMove(et)
         })
         this.content.on(Node.EventType.TOUCH_END,()=>{
             this.x_len = 0
@@ -150,10 +120,43 @@ export class game_list extends Component {
         })
     }
 
+    touchContentMove(et:EventTouch) {
+        this.onTouchActive = false
+        let p = new Vec3(et.getUILocation().x,et.getUILocation().y)
+        let n_p = this.content.parent.getComponent(UITransform).convertToNodeSpaceAR(p)
+        let pos = this.content.parent.getComponent(UITransform).convertToWorldSpaceAR(this.content.position)
+        if(this.x_len==0){
+            this.x_len = (et.getUILocation().x - pos.x)*1;
+        }
+        let content_position_x = n_p.x-this.x_len
+        // console.log('content_position_x=',content_position_x)
+        let select_page = gameManager.getStaticUserData().select_page
+        if(select_page==1 && content_position_x > this.content_original_pos.x - 50) {
+            return
+        }
+        if(select_page==this.getAllPage() && content_position_x < this.content_original_pos.x + 50) {
+            return
+        }
+        this.content.position = new Vec3(content_position_x,this.content.position.y);
+
+        // this.onTouchActive = false
+        // if( Math.abs(this.start_pos.x-et.getUILocation().x)<30){
+        //     this.start_pos = et.getUILocation()
+        //     this.onTouchActive = true
+        //     return
+        // }
+        // let p = new Vec3(et.getUILocation().x,et.getUILocation().y)
+        // let n_p = this.content.parent.getComponent(UITransform).convertToNodeSpaceAR(p)
+        // let pos = this.content.parent.getComponent(UITransform).convertToWorldSpaceAR(this.content.position)
+        // if(this.x_len==0){
+        //     this.x_len = (et.getUILocation().x - pos.x)*1;
+        // }
+        // this.content.position = new Vec3(n_p.x-this.x_len ,this.content.position.y);
+    }
+
     touchContentScroll() {
         this.onTouchActive = true
         if(this.content.position.x==this.content_original_pos.x) {
-            console.log('touchContentScroll touchContentScroll')
             return
         }
         if(this.content.position.x < 0) { // 向左滑动

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels