Commit cb954d20 authored by liujiaxin's avatar liujiaxin

ui

parent 2993b91f
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
"__id__": 2 "__id__": 2
}, },
{ {
"__id__": 492 "__id__": 501
} }
], ],
"_active": true, "_active": true,
...@@ -78,19 +78,19 @@ ...@@ -78,19 +78,19 @@
"__id__": 5 "__id__": 5
}, },
{ {
"__id__": 487 "__id__": 496
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 489 "__id__": 498
}, },
{ {
"__id__": 490 "__id__": 499
}, },
{ {
"__id__": 491 "__id__": 500
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -269,14 +269,14 @@ ...@@ -269,14 +269,14 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 484 "__id__": 493
}, },
{ {
"__id__": 485 "__id__": 494
} }
], ],
"_prefab": { "_prefab": {
"__id__": 486 "__id__": 495
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -547,8 +547,8 @@ ...@@ -547,8 +547,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-266.48123999999996, -841.25,
307.708, 505.75,
0, 0,
0, 0,
0, 0,
...@@ -613,11 +613,13 @@ ...@@ -613,11 +613,13 @@
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
"_target": null, "_target": {
"__id__": 2
},
"_alignFlags": 9, "_alignFlags": 9,
"_left": -393.23123999999996, "_left": 32,
"_right": 0, "_right": 0,
"_top": -369.958, "_top": 32,
"_bottom": 0, "_bottom": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
...@@ -1791,7 +1793,7 @@ ...@@ -1791,7 +1793,7 @@
"__id__": 286 "__id__": 286
} }
], ],
"_active": true, "_active": false,
"_components": [], "_components": [],
"_prefab": { "_prefab": {
"__id__": 290 "__id__": 290
...@@ -11920,7 +11922,7 @@ ...@@ -11920,7 +11922,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-914.5, -914.5,
512.866, 512,
0, 0,
0, 0,
0, 0,
...@@ -11991,7 +11993,7 @@ ...@@ -11991,7 +11993,7 @@
"_alignFlags": 9, "_alignFlags": 9,
"_left": 32, "_left": 32,
"_right": 0, "_right": 0,
"_top": 31.134000000000015, "_top": 32,
"_bottom": 0, "_bottom": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
...@@ -17923,14 +17925,14 @@ ...@@ -17923,14 +17925,14 @@
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 481 "__id__": 490
}, },
{ {
"__id__": 482 "__id__": 491
} }
], ],
"_prefab": { "_prefab": {
"__id__": 483 "__id__": 492
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -18144,19 +18146,28 @@ ...@@ -18144,19 +18146,28 @@
}, },
{ {
"__id__": 475 "__id__": 475
},
{
"__id__": 478
},
{
"__id__": 481
},
{
"__id__": 484
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 478 "__id__": 487
}, },
{ {
"__id__": 479 "__id__": 488
} }
], ],
"_prefab": { "_prefab": {
"__id__": 480 "__id__": 489
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -18207,7 +18218,7 @@ ...@@ -18207,7 +18218,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "New Label", "_name": "L",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 456 "__id__": 456
...@@ -18315,7 +18326,7 @@ ...@@ -18315,7 +18326,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "New Label", "_name": "O",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 456 "__id__": 456
...@@ -18423,7 +18434,7 @@ ...@@ -18423,7 +18434,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "New Label", "_name": "A",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 456 "__id__": 456
...@@ -18531,7 +18542,7 @@ ...@@ -18531,7 +18542,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "New Label", "_name": "D",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 456 "__id__": 456
...@@ -18639,7 +18650,7 @@ ...@@ -18639,7 +18650,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "New Label", "_name": "I",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 456 "__id__": 456
...@@ -18747,7 +18758,7 @@ ...@@ -18747,7 +18758,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "New Label", "_name": "N",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 456 "__id__": 456
...@@ -18855,7 +18866,7 @@ ...@@ -18855,7 +18866,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "New Label", "_name": "G",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 456 "__id__": 456
...@@ -18961,6 +18972,330 @@ ...@@ -18961,6 +18972,330 @@
"fileId": "7aMuSjK59En7Wj/y9VDtk4", "fileId": "7aMuSjK59En7Wj/y9VDtk4",
"sync": false "sync": false
}, },
{
"__type__": "cc.Node",
"_name": ".",
"_objFlags": 0,
"_parent": {
"__id__": 456
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 479
}
],
"_prefab": {
"__id__": 480
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 44.49,
"height": 100.8
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
150,
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": "46Genz4X9IIJ4CRkIyq4a4"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 478
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": ".",
"_N$string": ".",
"_fontSize": 80,
"_lineHeight": 80,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "fes8a9uxRF9ZPlQJeyZx+t"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 5
},
"asset": {
"__uuid__": "2a58ffcd-1d90-4998-a625-391e8f63e2bc"
},
"fileId": "eaBehzJDtNtZ+xWHTxpGtI",
"sync": false
},
{
"__type__": "cc.Node",
"_name": ".",
"_objFlags": 0,
"_parent": {
"__id__": 456
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 482
}
],
"_prefab": {
"__id__": 483
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 44.49,
"height": 100.8
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
150,
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": "d7VKQwOddFFJ2tqscYo71F"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 481
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": ".",
"_N$string": ".",
"_fontSize": 80,
"_lineHeight": 80,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "43qRb4fKJM64zy8ZNuOGrE"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 5
},
"asset": {
"__uuid__": "2a58ffcd-1d90-4998-a625-391e8f63e2bc"
},
"fileId": "eeBLP5d6hAVpf2kCE0xVNd",
"sync": false
},
{
"__type__": "cc.Node",
"_name": ".",
"_objFlags": 0,
"_parent": {
"__id__": 456
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 485
}
],
"_prefab": {
"__id__": 486
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 44.49,
"height": 100.8
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
150,
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": "b53XZgswFCh7o0mfhZH5xV"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 484
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": ".",
"_N$string": ".",
"_fontSize": 80,
"_lineHeight": 80,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "f3GKgX7d1JfpfV1NP9fgEI"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 5
},
"asset": {
"__uuid__": "2a58ffcd-1d90-4998-a625-391e8f63e2bc"
},
"fileId": "d812I/UIlJSqZSI6+e+xVK",
"sync": false
},
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
"_name": "", "_name": "",
...@@ -19443,7 +19778,7 @@ ...@@ -19443,7 +19778,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 488 "__id__": 497
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -19499,7 +19834,7 @@ ...@@ -19499,7 +19834,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 487 "__id__": 496
}, },
"_enabled": true, "_enabled": true,
"_layoutSize": { "_layoutSize": {
...@@ -19591,7 +19926,7 @@ ...@@ -19591,7 +19926,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 493 "__id__": 502
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -19647,7 +19982,7 @@ ...@@ -19647,7 +19982,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 492 "__id__": 501
}, },
"_enabled": true, "_enabled": true,
"cacertFile": { "cacertFile": {
......
...@@ -53,12 +53,41 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -53,12 +53,41 @@ export default class SceneComponent extends MyCocosSceneComponent {
FullPageNode: cc.Node[] = []; FullPageNode: cc.Node[] = [];
tw: cc.Tween = null; tws: any[] = [];
gameMachineService: any = null; gameMachineService: any = null;
LoadingCount: number = 0; LoadingCount: number = 1;
_mapScaleMin: number = 1;
_mapScaleMax: number = 1;
_cocosScale: number = 1;
onLoad(){
this.tws = [];
this.LoadingCount = 0;
this.initSize();
}
initSize() {
// 注意cc.winSize只有在适配后(修改fitHeight/fitWidth后)才能获取到正确的值,因此使用cc.getFrameSize()来获取初始的屏幕大小
let screen_size = cc.view.getFrameSize().width / cc.view.getFrameSize().height
let design_size = cc.Canvas.instance.designResolution.width / cc.Canvas.instance.designResolution.height
let f = screen_size >= design_size
cc.Canvas.instance.fitHeight = f
cc.Canvas.instance.fitWidth = !f
const frameSize = cc.view.getFrameSize();
this._frameSize = frameSize;
this._designSize = cc.view.getDesignResolutionSize();
let sx = cc.winSize.width / frameSize.width;
let sy = cc.winSize.height / frameSize.height;
this._cocosScale = Math.min(sx, sy);
sx = frameSize.width / this._designSize.width;
sy = frameSize.height / this._designSize.height;
this._mapScaleMin = Math.min(sx, sy) * this._cocosScale;
this._mapScaleMax = Math.max(sx, sy) * this._cocosScale;
}
start() { start() {
this.LoadingCount = 0;
this.showWaitingLetters(); this.showWaitingLetters();
this.initBg(); this.initBg();
this.initSubmarineView(); this.initSubmarineView();
...@@ -134,6 +163,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -134,6 +163,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
initSubmarineView() { initSubmarineView() {
this.submarineView.node.on('scrolling', this.moveSubmarineBackground, this); this.submarineView.node.on('scrolling', this.moveSubmarineBackground, this);
this.SubmarineView.active = false;
} }
moveSubmarineBackground() { moveSubmarineBackground() {
...@@ -511,7 +541,12 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -511,7 +541,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
if (this.LoadingCount <= 0) { if (this.LoadingCount <= 0) {
this.LoadingCount = 0; this.LoadingCount = 0;
setTimeout(() => { setTimeout(() => {
this.tw && this.tw.stop(); if (this.tws){
for (const tw of this.tws) {
tw.node.y = 0;
tw.tw.stop();
}
}
this.loading.active = false; this.loading.active = false;
}); });
} }
...@@ -525,14 +560,18 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -525,14 +560,18 @@ export default class SceneComponent extends MyCocosSceneComponent {
const text = this.loading.getChildByName('text') const text = this.loading.getChildByName('text')
text.children.forEach((node, idx) => { text.children.forEach((node, idx) => {
node.color = colorList[idx]; node.color = colorList[idx];
this.tw = cc.tween(node) const tw = cc.tween(node)
.delay(idx / 4) .delay(idx / 4)
.by(0.3, { y: 50 }, { easing: 'sineOut' }) .to(0.3, { y: 50 }, { easing: 'sineOut' })
.by(0.3, { y: -50 }, { easing: 'sineIn' }) .to(0.3, { y: -50 }, { easing: 'sineIn' })
.delay((text.children.length - idx) / 4) .delay((text.children.length - idx) / 4)
.union() .union()
.repeatForever() .repeatForever()
.start(); .start();
this.tws.push({
tw,
node
});
}); });
this.loading.active = true; this.loading.active = true;
} }
......
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