Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
babycare_xiaoxiao
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
翁阳
babycare_xiaoxiao
Commits
a4afda85
Commit
a4afda85
authored
Apr 12, 2021
by
邱旭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
换了点皮
parent
c841b9d9
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
75 additions
and
39 deletions
+75
-39
workspace.xml
.idea/workspace.xml
+20
-10
loadingBg.jpg
resource/loadingScene/loadingBg.jpg
+0
-0
loading_line_left1.png
resource/loadingScene/loading_line_left1.png
+0
-0
loading_line_left2.png
resource/loadingScene/loading_line_left2.png
+0
-0
loading_line_right.png
resource/loadingScene/loading_line_right.png
+0
-0
loading_shoes.png
resource/loadingScene/loading_shoes.png
+0
-0
res.json
resource/res.json
+1
-1
ResJson.ts
src/ResJson.ts
+1
-1
LoadingScene.ts
src/scene/LoadingScene.ts
+53
-27
No files found.
.idea/workspace.xml
View file @
a4afda85
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"0d3cb18d-e144-41a0-bc8b-4877c2e1fef1"
name=
"默认的"
comment=
"换了点皮"
/>
<list
default=
"true"
id=
"0d3cb18d-e144-41a0-bc8b-4877c2e1fef1"
name=
"默认的"
comment=
"换了点皮"
>
<change
afterPath=
"$PROJECT_DIR$/resource/loadingScene/loading_line_left1.png"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/resource/loadingScene/loading_line_left2.png"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/resource/loadingScene/loading_line_right.png"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/resource/loadingScene/loading_shoes.png"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/resource/loadingScene/loadingBg.jpg"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/resource/loadingScene/loadingBg.jpg"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/resource/res.json"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/resource/res.json"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/ResJson.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/ResJson.ts"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/scene/LoadingScene.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/scene/LoadingScene.ts"
afterDir=
"false"
/>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value=
"false"
/>
...
...
@@ -194,14 +204,7 @@
<workItem
from=
"1617871191619"
duration=
"121000"
/>
<workItem
from=
"1617890665920"
duration=
"181000"
/>
<workItem
from=
"1617960804439"
duration=
"639000"
/>
<workItem
from=
"1618193237335"
duration=
"12734000"
/>
</task>
<task
id=
"LOCAL-00042"
summary=
"m"
>
<created>
1614048624668
</created>
<option
name=
"number"
value=
"00042"
/>
<option
name=
"presentableId"
value=
"LOCAL-00042"
/>
<option
name=
"project"
value=
"LOCAL"
/>
<updated>
1614048624668
</updated>
<workItem
from=
"1618193237335"
duration=
"14471000"
/>
</task>
<task
id=
"LOCAL-00043"
summary=
"m"
>
<created>
1614049858546
</created>
...
...
@@ -539,7 +542,14 @@
<option
name=
"project"
value=
"LOCAL"
/>
<updated>
1618211067202
</updated>
</task>
<option
name=
"localTasksCounter"
value=
"91"
/>
<task
id=
"LOCAL-00091"
summary=
"换了点皮"
>
<created>
1618211471590
</created>
<option
name=
"number"
value=
"00091"
/>
<option
name=
"presentableId"
value=
"LOCAL-00091"
/>
<option
name=
"project"
value=
"LOCAL"
/>
<updated>
1618211471590
</updated>
</task>
<option
name=
"localTasksCounter"
value=
"92"
/>
<servers
/>
</component>
<component
name=
"TypeScriptGeneratedFilesManager"
>
...
...
resource/loadingScene/loadingBg.jpg
View replaced file @
c841b9d9
View file @
a4afda85
This diff is collapsed.
Click to expand it.
resource/loadingScene/loading_line_left1.png
0 → 100644
View file @
a4afda85
114 Bytes
resource/loadingScene/loading_line_left2.png
0 → 100644
View file @
a4afda85
115 Bytes
resource/loadingScene/loading_line_right.png
0 → 100644
View file @
a4afda85
115 Bytes
resource/loadingScene/loading_shoes.png
0 → 100644
View file @
a4afda85
55.3 KB
resource/res.json
View file @
a4afda85
...
...
@@ -65,7 +65,7 @@
"name"
:
"fiveVerHorDis"
},
{
"keys"
:
"loadingBg.jpg,loadingLight0.png,loadingLight1.png,loadingLight10.png,loadingLight11.png,loadingLight12.png,loadingLight13.png,loadingLight14.png,loadingLight15.png,loadingLight16.png,loadingLight17.png,loadingLight18.png,loadingLight19.png,loadingLight2.png,loadingLight20.png,loadingLight21.png,loadingLight22.png,loadingLight23.png,loadingLight24.png,loadingLight25.png,loadingLight26.png,loadingLight27.png,loadingLight28.png,loadingLight29.png,loadingLight3.png,loadingLight4.png,loadingLight5.png,loadingLight6.png,loadingLight7.png,loadingLight8.png,loadingLight9.png,loadingPro.png"
,
"keys"
:
"loadingBg.jpg,loadingLight0.png,loadingLight1.png,loadingLight10.png,loadingLight11.png,loadingLight12.png,loadingLight13.png,loadingLight14.png,loadingLight15.png,loadingLight16.png,loadingLight17.png,loadingLight18.png,loadingLight19.png,loadingLight2.png,loadingLight20.png,loadingLight21.png,loadingLight22.png,loadingLight23.png,loadingLight24.png,loadingLight25.png,loadingLight26.png,loadingLight27.png,loadingLight28.png,loadingLight29.png,loadingLight3.png,loadingLight4.png,loadingLight5.png,loadingLight6.png,loadingLight7.png,loadingLight8.png,loadingLight9.png,loadingPro.png
,loading_line_left1.png,loading_line_left2.png,loading_line_right.png,loading_shoes.png
"
,
"name"
:
"loadingScene"
},
{
...
...
src/ResJson.ts
View file @
a4afda85
...
...
@@ -65,7 +65,7 @@ export const ResJson = {
"name"
:
"fiveVerHorDis"
},
{
"keys"
:
"loadingBg.jpg,loadingLight0.png,loadingLight1.png,loadingLight10.png,loadingLight11.png,loadingLight12.png,loadingLight13.png,loadingLight14.png,loadingLight15.png,loadingLight16.png,loadingLight17.png,loadingLight18.png,loadingLight19.png,loadingLight2.png,loadingLight20.png,loadingLight21.png,loadingLight22.png,loadingLight23.png,loadingLight24.png,loadingLight25.png,loadingLight26.png,loadingLight27.png,loadingLight28.png,loadingLight29.png,loadingLight3.png,loadingLight4.png,loadingLight5.png,loadingLight6.png,loadingLight7.png,loadingLight8.png,loadingLight9.png,loadingPro.png"
,
"keys"
:
"loadingBg.jpg,loadingLight0.png,loadingLight1.png,loadingLight10.png,loadingLight11.png,loadingLight12.png,loadingLight13.png,loadingLight14.png,loadingLight15.png,loadingLight16.png,loadingLight17.png,loadingLight18.png,loadingLight19.png,loadingLight2.png,loadingLight20.png,loadingLight21.png,loadingLight22.png,loadingLight23.png,loadingLight24.png,loadingLight25.png,loadingLight26.png,loadingLight27.png,loadingLight28.png,loadingLight29.png,loadingLight3.png,loadingLight4.png,loadingLight5.png,loadingLight6.png,loadingLight7.png,loadingLight8.png,loadingLight9.png,loadingPro.png
,loading_line_left1.png,loading_line_left2.png,loading_line_right.png,loading_shoes.png
"
,
"name"
:
"loadingScene"
},
{
...
...
src/scene/LoadingScene.ts
View file @
a4afda85
...
...
@@ -9,6 +9,9 @@ import { MapScene } from "./map/MapScene";
import
TextField
=
FYGE
.
TextField
;
import
Tween
=
FYGE
.
Tween
;
import
FrameAni
=
FYGE
.
FrameAni
;
import
Sprite
=
FYGE
.
Sprite
;
import
Event
=
FYGE
.
Event
;
import
Ease
=
FYGE
.
Ease
;
export
class
LoadingScene
extends
Scene
{
get
groupNames
()
{
...
...
@@ -17,12 +20,28 @@ export class LoadingScene extends Scene {
progressBar
:
ProgressBarS
;
loadingTxt
:
TextField
;
shoes
:
Sprite
;
line_L1
:
Sprite
;
line_L2
:
Sprite
;
line_R
:
Sprite
;
initUi
()
{
//适配
this
.
y
=
-
layers
.
stageOffsetY
;
//背景
this
.
addChild
(
FYGE
.
Sprite
.
fromFrame
(
"loadingBg.jpg"
))
this
.
addChild
(
FYGE
.
Sprite
.
fromFrame
(
"loadingBg.jpg"
));
this
.
shoes
=
this
.
addChild
(
Tools
.
getSprite
(
"loading_shoes.png"
));
this
.
shoes
.
position
.
set
(
257
,
1010
);
this
.
line_L1
=
this
.
addChild
(
Tools
.
getSprite
(
"loading_line_left1.png"
));
this
.
line_L1
.
position
.
set
(
205
,
552
);
this
.
line_L2
=
this
.
addChild
(
Tools
.
getSprite
(
"loading_line_left2.png"
));
this
.
line_L2
.
position
.
set
(
162
,
576
);
this
.
line_R
=
this
.
addChild
(
Tools
.
getSprite
(
"loading_line_right.png"
));
this
.
line_R
.
position
.
set
(
527
,
554
);
//进度条帧动画
const
pro
=
this
.
addChild
(
Tools
.
getSprite
(
'loadingPro.png'
));
...
...
@@ -32,35 +51,39 @@ export class LoadingScene extends Scene {
this
.
progressBar
=
new
ProgressBarS
(
pro
);
const
frames
=
[];
for
(
let
i
=
0
;
i
<=
29
;
i
++
)
{
for
(
let
i
=
0
;
i
<=
29
;
i
++
)
{
frames
.
push
(
RES
.
getRes
(
`loadingLight
${
i
}
.png`
));
}
const
ani
=
new
FrameAni
(
frames
);
this
.
addChild
(
ani
);
ani
.
position
.
set
(
375
,
665
);
ani
.
play
(
1
);
}
dotTween
=
null
;
dotCount
=
0
;
/**
* string 乘法
* @param str
* @param by
*/
strMul
(
str
,
by
)
{
by
=
(
by
>>
0
);
const
t
=
(
by
>
1
?
this
.
strMul
(
str
,
by
/
2
)
:
''
);
return
t
+
(
by
%
2
?
t
+
str
:
t
);
this
.
shoes
.
anchor
.
set
(
20
,
200
);
Tween
.
get
(
this
.
shoes
,
{
loop
:
true
})
.
to
({
rotation
:
10
},
2000
)
.
to
({
rotation
:
0
},
2000
);
Tween
.
get
(
this
.
line_L1
,
{
loop
:
true
})
.
to
({
x
:
175
},
700
)
.
to
({
x
:
205
},
700
);
Tween
.
get
(
this
.
line_L2
,
{
loop
:
true
})
.
to
({
x
:
190
},
700
)
.
to
({
x
:
162
},
700
);
Tween
.
get
(
this
.
line_R
,
{
loop
:
true
})
.
to
({
x
:
497
},
700
)
.
to
({
x
:
527
},
700
);
}
async
start
()
{
super
.
start
()
this
.
addEventListener
(
FYGE
.
Event
.
PROGRESS
,
this
.
progressEvent
,
this
)
this
.
addEventListener
(
Event
.
PROGRESS
,
this
.
progressEvent
,
this
)
//首次进度一点
this
.
dispatchEvent
(
FYGE
.
Event
.
PROGRESS
,
0.2
)
this
.
dispatchEvent
(
Event
.
PROGRESS
,
0.2
)
//获取app数据
const
{
data
}
=
await
sendTbNet
(
TbNetName
.
getAppData
);
...
...
@@ -76,27 +99,27 @@ export class LoadingScene extends Scene {
const
baseInfo
=
await
Tools
.
getGameInfo
();
if
(
!
baseInfo
)
showToast
(
"获取游戏信息失败"
);
this
.
dispatchEvent
(
FYGE
.
Event
.
PROGRESS
,
0.5
);
this
.
dispatchEvent
(
Event
.
PROGRESS
,
0.5
);
await
RES
.
loadGroup
(
"map"
);
this
.
dispatchEvent
(
FYGE
.
Event
.
PROGRESS
,
0.6
);
this
.
dispatchEvent
(
FYGE
.
Event
.
PROGRESS
,
0.7
);
this
.
dispatchEvent
(
FYGE
.
Event
.
PROGRESS
,
0.8
);
this
.
dispatchEvent
(
FYGE
.
Event
.
PROGRESS
,
0.9
);
this
.
dispatchEvent
(
Event
.
PROGRESS
,
0.6
);
this
.
dispatchEvent
(
Event
.
PROGRESS
,
0.7
);
this
.
dispatchEvent
(
Event
.
PROGRESS
,
0.8
);
this
.
dispatchEvent
(
Event
.
PROGRESS
,
0.9
);
this
.
dispatchEvent
(
FYGE
.
Event
.
PROGRESS
,
1
);
this
.
dispatchEvent
(
Event
.
PROGRESS
,
1
);
}
// private lastP=0
progressEvent
(
e
:
FYGE
.
Event
)
{
progressEvent
(
e
:
Event
)
{
let
pro
=
e
.
data
;
FYGE
.
Tween
.
get
(
this
.
progressBar
,
null
,
null
,
true
)
Tween
.
get
(
this
.
progressBar
,
null
,
null
,
true
)
.
to
({
value
:
pro
},
2000
/**(p-this.lastP)*/
)
.
call
(()
=>
{
if
(
pro
>=
1
)
{
this
.
removeEventListener
(
FYGE
.
Event
.
PROGRESS
,
this
.
progressEvent
,
this
);
changeScene
(
MapScene
,
{
from
:
"loading"
});
changeScene
(
MapScene
,
{
from
:
"loading"
});
// changeScene(PlayScene, { chapter: 20 });
sendTbNet
(
TbNetName
.
openMusic
,
{
isOn
:
true
});
}
...
...
@@ -110,7 +133,10 @@ export class LoadingScene extends Scene {
super
.
destroy
()
//到时如果内存炸了,考虑销毁用过的贴图缓存,待测试,在RES里写个根据销毁组内贴图的方法
Tween
.
removeTweenSelf
(
this
.
dotTween
);
Tween
.
removeTweens
(
this
.
shoes
);
Tween
.
removeTweens
(
this
.
line_L1
);
Tween
.
removeTweens
(
this
.
line_L2
);
Tween
.
removeTweens
(
this
.
line_R
);
}
}
...
...
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