Commit 0375cd6c authored by 李维's avatar 李维

优化进度条

parent e898f71c
...@@ -320,13 +320,13 @@ ...@@ -320,13 +320,13 @@
"__id__": 1085 "__id__": 1085
}, },
{ {
"__id__": 1104 "__id__": 288
}, },
{ {
"__id__": 288 "__id__": 1104
}, },
{ {
"__id__": 1111 "__id__": 1110
} }
], ],
"_active": true, "_active": true,
...@@ -49230,13 +49230,13 @@ ...@@ -49230,13 +49230,13 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
} }
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 1,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "8117c75d-0a4b-4e00-8337-908519edffff" "__uuid__": "8117c75d-0a4b-4e00-8337-908519edffff"
}, },
"_type": 1, "_type": 1,
"_sizeMode": 1, "_sizeMode": 0,
"_fillType": 0, "_fillType": 0,
"_fillCenter": { "_fillCenter": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -49292,6 +49292,7 @@ ...@@ -49292,6 +49292,7 @@
"bar": { "bar": {
"__id__": 1095 "__id__": 1095
}, },
"maxWidth": 1348,
"process": { "process": {
"__id__": 1094 "__id__": 1094
}, },
...@@ -49399,7 +49400,7 @@ ...@@ -49399,7 +49400,7 @@
"node": { "node": {
"__id__": 1085 "__id__": 1085
}, },
"_enabled": true, "_enabled": false,
"_materials": [ "_materials": [
{ {
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
...@@ -49463,8 +49464,8 @@ ...@@ -49463,8 +49464,8 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "tipsLayer", "_name": "finishLayer",
"_objFlags": 512, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 8 "__id__": 8
}, },
...@@ -49476,7 +49477,10 @@ ...@@ -49476,7 +49477,10 @@
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 1110 "__id__": 1108
},
{
"__id__": 1109
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -49525,87 +49529,21 @@ ...@@ -49525,87 +49529,21 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "b2+0QRHqhONpO/79w7iCil" "_id": "e13twzo8VOOoJzvXobl3sr"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "tips", "_name": "bg",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 1104 "__id__": 1104
}, },
"_children": [ "_children": [],
{
"__id__": 1106
}
],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 1108 "__id__": 1106
},
{
"__id__": 1109
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 398,
"height": 110
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-354,
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": "35zPmaqRFKO61TT6ctCm23"
},
{
"__type__": "cc.Node",
"_name": "label",
"_objFlags": 0,
"_parent": {
"__id__": 1105
}, },
"_children": [],
"_active": true,
"_components": [
{ {
"__id__": 1107 "__id__": 1107
} }
...@@ -49621,8 +49559,8 @@ ...@@ -49621,8 +49559,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 60, "width": 1920,
"height": 30 "height": 1080
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -49656,40 +49594,7 @@ ...@@ -49656,40 +49594,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "efCSXIBTtIpZ+/yHqkyCTO" "_id": "adEnzeBAtPn7/mR7PTJDyg"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1106
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "提示",
"_N$string": "提示",
"_fontSize": 30,
"_lineHeight": 30,
"_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": 2,
"_id": "76HU69UkBKs6v/jB9TBarh"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
...@@ -49707,9 +49612,9 @@ ...@@ -49707,9 +49612,9 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "297c6c6f-c675-4606-bb8a-11e4fea0eba0" "__uuid__": "1c0a6b7e-0045-4448-9809-4abd334821cd"
}, },
"_type": 1, "_type": 0,
"_sizeMode": 0, "_sizeMode": 0,
"_fillType": 0, "_fillType": 0,
"_fillCenter": { "_fillCenter": {
...@@ -49721,7 +49626,7 @@ ...@@ -49721,7 +49626,7 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "fc587VKDtGr7lP2VK6jKGH" "_id": "0adJROaKdBRaT9hXwvkCgn"
}, },
{ {
"__type__": "cc.Widget", "__type__": "cc.Widget",
...@@ -49733,11 +49638,11 @@ ...@@ -49733,11 +49638,11 @@
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
"_target": null, "_target": null,
"_alignFlags": 4, "_alignFlags": 45,
"_left": 0, "_left": 0,
"_right": 0, "_right": 0,
"_top": 0, "_top": 0,
"_bottom": 131, "_bottom": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_isAbsLeft": true, "_isAbsLeft": true,
...@@ -49748,7 +49653,7 @@ ...@@ -49748,7 +49653,7 @@
"_isAbsVerticalCenter": true, "_isAbsVerticalCenter": true,
"_originalWidth": 0, "_originalWidth": 0,
"_originalHeight": 0, "_originalHeight": 0,
"_id": "afIfyPcpZDZbB+4yhAojNv" "_id": "74Bk+o5D9A5LMSt0xR2+Mj"
}, },
{ {
"__type__": "cc.Widget", "__type__": "cc.Widget",
...@@ -49775,25 +49680,32 @@ ...@@ -49775,25 +49680,32 @@
"_isAbsVerticalCenter": true, "_isAbsVerticalCenter": true,
"_originalWidth": 0, "_originalWidth": 0,
"_originalHeight": 0, "_originalHeight": 0,
"_id": "7b2+UPIapMc4GikO2k1Ue7" "_id": "01nR8fepxG6ZcOHWqf1F6F"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.BlockInputEvents",
"_name": "finishLayer", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": {
"__id__": 1104
},
"_enabled": true,
"_id": "99TmKuadlDrpqTImwqqu6G"
},
{
"__type__": "cc.Node",
"_name": "tipsLayer",
"_objFlags": 512,
"_parent": { "_parent": {
"__id__": 8 "__id__": 8
}, },
"_children": [ "_children": [
{ {
"__id__": 1112 "__id__": 1111
} }
], ],
"_active": false, "_active": false,
"_components": [ "_components": [
{
"__id__": 1115
},
{ {
"__id__": 1116 "__id__": 1116
} }
...@@ -49844,11 +49756,80 @@ ...@@ -49844,11 +49756,80 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "e13twzo8VOOoJzvXobl3sr" "_id": "b2+0QRHqhONpO/79w7iCil"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "bg", "_name": "tips",
"_objFlags": 0,
"_parent": {
"__id__": 1110
},
"_children": [
{
"__id__": 1112
}
],
"_active": true,
"_components": [
{
"__id__": 1114
},
{
"__id__": 1115
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 398,
"height": 110
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-354,
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": "35zPmaqRFKO61TT6ctCm23"
},
{
"__type__": "cc.Node",
"_name": "label",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 1111 "__id__": 1111
...@@ -49858,9 +49839,6 @@ ...@@ -49858,9 +49839,6 @@
"_components": [ "_components": [
{ {
"__id__": 1113 "__id__": 1113
},
{
"__id__": 1114
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -49874,8 +49852,8 @@ ...@@ -49874,8 +49852,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 1920, "width": 60,
"height": 1080 "height": 30
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -49909,10 +49887,10 @@ ...@@ -49909,10 +49887,10 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "adEnzeBAtPn7/mR7PTJDyg" "_id": "efCSXIBTtIpZ+/yHqkyCTO"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Label",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
...@@ -49926,10 +49904,43 @@ ...@@ -49926,10 +49904,43 @@
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_string": "提示",
"_N$string": "提示",
"_fontSize": 30,
"_lineHeight": 30,
"_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": 2,
"_id": "76HU69UkBKs6v/jB9TBarh"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1111
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "1c0a6b7e-0045-4448-9809-4abd334821cd" "__uuid__": "297c6c6f-c675-4606-bb8a-11e4fea0eba0"
}, },
"_type": 0, "_type": 1,
"_sizeMode": 0, "_sizeMode": 0,
"_fillType": 0, "_fillType": 0,
"_fillCenter": { "_fillCenter": {
...@@ -49941,23 +49952,23 @@ ...@@ -49941,23 +49952,23 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "0adJROaKdBRaT9hXwvkCgn" "_id": "fc587VKDtGr7lP2VK6jKGH"
}, },
{ {
"__type__": "cc.Widget", "__type__": "cc.Widget",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 1112 "__id__": 1111
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
"_target": null, "_target": null,
"_alignFlags": 45, "_alignFlags": 4,
"_left": 0, "_left": 0,
"_right": 0, "_right": 0,
"_top": 0, "_top": 0,
"_bottom": 0, "_bottom": 131,
"_verticalCenter": 0, "_verticalCenter": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_isAbsLeft": true, "_isAbsLeft": true,
...@@ -49968,14 +49979,14 @@ ...@@ -49968,14 +49979,14 @@
"_isAbsVerticalCenter": true, "_isAbsVerticalCenter": true,
"_originalWidth": 0, "_originalWidth": 0,
"_originalHeight": 0, "_originalHeight": 0,
"_id": "74Bk+o5D9A5LMSt0xR2+Mj" "_id": "afIfyPcpZDZbB+4yhAojNv"
}, },
{ {
"__type__": "cc.Widget", "__type__": "cc.Widget",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 1111 "__id__": 1110
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -49995,17 +50006,7 @@ ...@@ -49995,17 +50006,7 @@
"_isAbsVerticalCenter": true, "_isAbsVerticalCenter": true,
"_originalWidth": 0, "_originalWidth": 0,
"_originalHeight": 0, "_originalHeight": 0,
"_id": "01nR8fepxG6ZcOHWqf1F6F" "_id": "7b2+UPIapMc4GikO2k1Ue7"
},
{
"__type__": "cc.BlockInputEvents",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1111
},
"_enabled": true,
"_id": "99TmKuadlDrpqTImwqqu6G"
}, },
{ {
"__type__": "cc.Widget", "__type__": "cc.Widget",
......
...@@ -245,7 +245,6 @@ export abstract class middleLayerBase extends cc.Component { ...@@ -245,7 +245,6 @@ export abstract class middleLayerBase extends cc.Component {
bundle.loadScene(sceneName, null, (finish, total, item) => { bundle.loadScene(sceneName, null, (finish, total, item) => {
this.setLoadingProgressBar(Math.floor(finish / total * 100)); this.setLoadingProgressBar(Math.floor(finish / total * 100));
}, (err, scene) => { }, (err, scene) => {
this.setLoadingProgressBar(0);
this.courseOpenTimeStamp = Date.now(); this.courseOpenTimeStamp = Date.now();
cc.director.runScene(scene, null, () => { cc.director.runScene(scene, null, () => {
console.log('sceneName = ' + sceneName); console.log('sceneName = ' + sceneName);
......
...@@ -13,6 +13,9 @@ export default class ProgressClass extends cc.Component { ...@@ -13,6 +13,9 @@ export default class ProgressClass extends cc.Component {
@property(cc.Node) @property(cc.Node)
bar: cc.Node = null; bar: cc.Node = null;
@property(cc.Integer)
maxWidth: cc.Integer = 100;
@property(cc.Node) @property(cc.Node)
process: cc.Node = null; process: cc.Node = null;
...@@ -21,25 +24,14 @@ export default class ProgressClass extends cc.Component { ...@@ -21,25 +24,14 @@ export default class ProgressClass extends cc.Component {
} }
barBaseW = null; barBaseW = null;
barSpr = null;
barSf = null;
init() { init() {
this.barBaseW = this.bar.width;
this.barSpr = this.bar.getComponent(cc.Sprite);
this.barSf = this.barSpr.spriteFrame;
this.setProgress(0); this.setProgress(0);
} }
setProgress(progress) { setProgress(progress) {
if (!this.barSf) { const scale = progress <= 1 ? progress : 1;
return; this.bar.width = this.maxWidth * scale;
} // console.log(this.bar.width)
const w = this.barBaseW * progress;
const rect = this.barSf.getRect();
rect.width = w;
this.bar.width = w;
this.barSpr.spriteFrame.setRect(rect);
} }
onEnable() { onEnable() {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": true,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 1400, "width": 1400,
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
"height": 46, "height": 46,
"rawWidth": 1400, "rawWidth": 1400,
"rawHeight": 102, "rawHeight": 102,
"borderTop": 0, "borderTop": 6,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 24,
"borderRight": 0, "borderRight": 44,
"subMetas": {} "subMetas": {}
} }
} }
......
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