Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_kyxq
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
middleLayer_for_kyxq
Commits
0375cd6c
Commit
0375cd6c
authored
Nov 11, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化进度条
parent
e898f71c
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
167 additions
and
175 deletions
+167
-175
middleLayer_for_kyxq.fire
assets/middleLayer_for_kyxq/scene/middleLayer_for_kyxq.fire
+157
-156
middleLayerBase.ts
assets/middleLayer_for_kyxq/script/middleLayerBase.ts
+0
-1
progress.ts
assets/middleLayer_for_kyxq/script/progress.ts
+6
-14
bg_progress.png.meta
...Layer_for_kyxq/textures/loadingLayer/bg_progress.png.meta
+4
-4
No files found.
assets/middleLayer_for_kyxq/scene/middleLayer_for_kyxq.fire
View file @
0375cd6c
This diff is collapsed.
Click to expand it.
assets/middleLayer_for_kyxq/script/middleLayerBase.ts
View file @
0375cd6c
...
@@ -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
);
...
...
assets/middleLayer_for_kyxq/script/progress.ts
View file @
0375cd6c
...
@@ -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
()
{
...
...
assets/middleLayer_for_kyxq/textures/loadingLayer/bg_progress.png.meta
View file @
0375cd6c
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"type": "sprite",
"type": "sprite",
"wrapMode": "clamp",
"wrapMode": "clamp",
"filterMode": "bilinear",
"filterMode": "bilinear",
"premultiplyAlpha":
fals
e,
"premultiplyAlpha":
tru
e,
"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": {}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment