Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-engine
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
劳工
zeroing-engine
Commits
9dbc3a99
Commit
9dbc3a99
authored
Jun 17, 2020
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复
parent
c7394971
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
GameStage.ts
src/zeroing/game-warpper/GameStage.ts
+7
-5
Toast.ts
src/zeroing/game-warpper/Toast.ts
+3
-1
No files found.
src/zeroing/game-warpper/GameStage.ts
View file @
9dbc3a99
...
@@ -170,11 +170,9 @@ export class GameStage extends Node {
...
@@ -170,11 +170,9 @@ export class GameStage extends Node {
loadingView
=
await
this
.
instantiateView
(
loadingViewName
,
true
,
false
);
loadingView
=
await
this
.
instantiateView
(
loadingViewName
,
true
,
false
);
this
.
_loadingView
.
addChild
(
loadingView
);
this
.
_loadingView
.
addChild
(
loadingView
);
}
}
Tween
.
get
(
this
.
_loadingView
,
null
,
null
,
true
)
.
to
({
alpha
:
0
},
200
)
.
call
(()
=>
{
this
.
_loadingView
.
visible
=
true
;
this
.
_loadingView
.
visible
=
true
;
});
Tween
.
get
(
this
.
_loadingView
,
null
,
null
,
true
)
.
to
({
alpha
:
1
},
200
);
}
}
/**
/**
...
@@ -183,7 +181,7 @@ export class GameStage extends Node {
...
@@ -183,7 +181,7 @@ export class GameStage extends Node {
hideInnerLoadingView
()
{
hideInnerLoadingView
()
{
if
(
this
.
_loadingView
.
visible
)
{
if
(
this
.
_loadingView
.
visible
)
{
Tween
.
get
(
this
.
_loadingView
,
null
,
null
,
true
)
Tween
.
get
(
this
.
_loadingView
,
null
,
null
,
true
)
.
to
({
alpha
:
1
},
200
)
.
to
({
alpha
:
0
},
200
)
.
call
(()
=>
{
.
call
(()
=>
{
this
.
_loadingView
.
visible
=
false
;
this
.
_loadingView
.
visible
=
false
;
});
});
...
@@ -330,6 +328,9 @@ export class GameStage extends Node {
...
@@ -330,6 +328,9 @@ export class GameStage extends Node {
};
};
async
loadPreloadAssets
(
onPreloadAssetsProgress
,
onPreloadAssetsComplete
)
{
async
loadPreloadAssets
(
onPreloadAssetsProgress
,
onPreloadAssetsComplete
)
{
//直接显示菊花loading
onPreloadAssetsProgress
&&
onPreloadAssetsProgress
(
0
,
1
);
const
{
assets
,
customs
}
=
this
.
_config
;
const
{
assets
,
customs
}
=
this
.
_config
;
let
loaded
=
0
;
let
loaded
=
0
;
...
@@ -340,6 +341,7 @@ export class GameStage extends Node {
...
@@ -340,6 +341,7 @@ export class GameStage extends Node {
if
(
assetsToLoad
.
length
>
0
)
{
if
(
assetsToLoad
.
length
>
0
)
{
await
this
.
showInnerLoadingView
();
await
this
.
showInnerLoadingView
();
onPreloadAssetsComplete
&&
onPreloadAssetsComplete
();
await
loadAssetsGroups
({
await
loadAssetsGroups
({
preload
:
assetsToLoad
,
preload
:
assetsToLoad
,
},
async
()
=>
{
},
async
()
=>
{
...
...
src/zeroing/game-warpper/Toast.ts
View file @
9dbc3a99
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
import
{
GameStage
}
from
"./GameStage"
;
import
{
GameStage
}
from
"./GameStage"
;
import
{
Label
,
Rect
,
Node
}
from
"./nodes/index"
;
import
{
Label
,
Rect
,
Node
}
from
"./nodes/index"
;
import
{
Tween
}
from
"../../2d/tween/index"
;
import
{
Tween
}
from
"../../2d/tween/index"
;
import
{
TEXT_ALIGN
}
from
"../../2d/const"
;
export
class
Toast
extends
Node
{
export
class
Toast
extends
Node
{
private
_contentSample
:
Node
;
private
_contentSample
:
Node
;
...
@@ -82,7 +83,7 @@ export class Toast extends Node {
...
@@ -82,7 +83,7 @@ export class Toast extends Node {
}
}
if
(
!
view
)
{
if
(
!
view
)
{
if
(
!
this
.
_contentSample
)
{
if
(
!
this
.
_contentSample
)
{
const
{
borderRadius
=
10
,
labColor
=
'white'
,
labSize
=
30
,
bgColor
=
'black'
,
bgAlpha
=
0.7
}
=
props
;
const
{
borderRadius
=
10
,
labColor
=
'white'
,
labSize
=
30
,
labelAlign
=
TEXT_ALIGN
.
CENTER
,
bgColor
=
'black'
,
bgAlpha
=
0.7
}
=
props
;
this
.
_contentSample
=
new
Node
();
this
.
_contentSample
=
new
Node
();
let
bg
=
new
Rect
();
let
bg
=
new
Rect
();
...
@@ -96,6 +97,7 @@ export class Toast extends Node {
...
@@ -96,6 +97,7 @@ export class Toast extends Node {
lab
.
name
=
'lab'
;
lab
.
name
=
'lab'
;
lab
.
fillColor
=
labColor
;
lab
.
fillColor
=
labColor
;
lab
.
size
=
labSize
;
lab
.
size
=
labSize
;
lab
.
textAlign
=
labelAlign
;
this
.
_contentSample
.
addChild
(
lab
);
this
.
_contentSample
.
addChild
(
lab
);
}
}
view
=
this
.
_contentSample
;
view
=
this
.
_contentSample
;
...
...
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