Commit 3321f247 authored by Tt's avatar Tt

调整1 2 个适配

parent 9545e3c9
......@@ -81,13 +81,13 @@
"_active": true,
"_components": [
{
"__id__": 51
"__id__": 53
},
{
"__id__": 52
"__id__": 54
},
{
"__id__": 53
"__id__": 55
}
],
"_prefab": null,
......@@ -773,15 +773,18 @@
},
{
"__id__": 41
},
{
"__id__": 49
}
],
"_active": true,
"_components": [
{
"__id__": 49
"__id__": 51
},
{
"__id__": 50
"__id__": 52
}
],
"_prefab": null,
......@@ -1759,8 +1762,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 126,
"height": 56.4
"width": 226,
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1772,7 +1775,7 @@
"ctor": "Float64Array",
"array": [
-13.107,
-128.045,
-130.562,
0,
0,
0,
......@@ -1814,8 +1817,8 @@
"_string": "剧情预告",
"_N$string": "剧情预告",
"_fontSize": 30,
"_lineHeight": 40,
"_enableWrapText": true,
"_lineHeight": 30,
"_enableWrapText": false,
"_N$file": {
"__uuid__": "8700c4ce-513b-4374-b284-b51c1d29393c"
},
......@@ -1827,7 +1830,7 @@
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$overflow": 2,
"_N$cacheMode": 0,
"_id": "4c7HOTq3NLJLT472LpS2+F"
},
......@@ -2045,7 +2048,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1292,
"width": 1334,
"height": 600
},
"_anchorPoint": {
......@@ -2057,7 +2060,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-628.723,
-667,
-27.235,
0,
0,
......@@ -2114,7 +2117,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1292,
"width": 1334,
"height": 600
},
"_anchorPoint": {
......@@ -2234,8 +2237,8 @@
"height": 40
},
"_N$startAxis": 0,
"_N$paddingLeft": 0,
"_N$paddingRight": 0,
"_N$paddingLeft": 100,
"_N$paddingRight": 100,
"_N$paddingTop": 0,
"_N$paddingBottom": 0,
"_N$spacingX": -17,
......@@ -2329,8 +2332,8 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 40,
"_left": 38.277000000000044,
"_right": 3.7229999999999563,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
......@@ -2345,6 +2348,100 @@
"_originalHeight": 0,
"_id": "26mF12Z0VGNJ5V9nzBTiCg"
},
{
"__type__": "cc.Node",
"_name": "layout",
"_objFlags": 0,
"_parent": {
"__id__": 15
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 50
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 880,
"height": 200
},
"_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": "64PQnXAjxHNoO/UJsE3qC+"
},
{
"__type__": "cc.Layout",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 49
},
"_enabled": true,
"_layoutSize": {
"__type__": "cc.Size",
"width": 880,
"height": 200
},
"_resize": 0,
"_N$layoutType": 1,
"_N$cellSize": {
"__type__": "cc.Size",
"width": 40,
"height": 40
},
"_N$startAxis": 0,
"_N$paddingLeft": 0,
"_N$paddingRight": 0,
"_N$paddingTop": 0,
"_N$paddingBottom": 0,
"_N$spacingX": 0,
"_N$spacingY": 0,
"_N$verticalDirection": 1,
"_N$horizontalDirection": 0,
"_N$affectedByScale": false,
"_id": "c5NrIm611GRpfTxX4SLbOe"
},
{
"__type__": "cfef9RS1bRFZqpW++GCoUte",
"_name": "",
......
......@@ -34,13 +34,18 @@ export default class NewClass extends cc.Component {
private layout: cc.Node;
private item: cc.Node;
onLoad() {
let scrollview = this.node.getChildByName("scrollview");
let view = scrollview.getChildByName("view");
this.layout = view.getChildByName("content");
this.item = this.node.getChildByName("item");
this.item.active = false;
}
initView() {
if (this.list.length < 3) {
this.layout = this.node.getChildByName("layout");
this.layout.width = this.list.length == 2 ? 880 : 440;
} else {
let scrollview = this.node.getChildByName("scrollview");
let view = scrollview.getChildByName("view");
this.layout = view.getChildByName("content");
}
this.list.forEach((data, index) => {
let item = cc.instantiate(this.item);
this.updateItem(item, data, index);
......
......@@ -34,30 +34,34 @@ export const defaultData = {
//游戏列表
gameList: [{
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记1',
name: '小红帽历险记1设施难以熊圣诞节否',
locked: false,
id: 1231,
}, {
},
{
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记2',
locked: false,
id: 1232,
}, {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记3',
locked: false,
id: 1233,
}, {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记4',
locked: false,
id: 1234,
}, {
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记5',
locked: false,
id: 1235,
totalIcon: 100,
}],
},
// {
// img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
// name: '小红帽历险记3',
// locked: false,
// id: 1233,
// },
// {
// img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
// name: '小红帽历险记4',
// locked: false,
// id: 1234,
// }, {
// img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
// name: '小红帽历险记5',
// locked: false,
// id: 1235,
// totalIcon: 100,
// }
],
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment