Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
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
wildfirecode13
xiaoxiaole
Commits
22510841
Commit
22510841
authored
Nov 08, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
b20675f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
13 deletions
+23
-13
Toast2.ts
egret/libs/new_wx/components/Toast2.ts
+17
-12
toastCtrl2.ts
egret/libs/new_wx/ctrls/toastCtrl2.ts
+6
-1
No files found.
egret/libs/new_wx/components/Toast2.ts
View file @
22510841
...
...
@@ -9,20 +9,25 @@ export default class Toast2 extends ComponentBase {
get
skinResKey
()
{
return
'common'
}
get
skinKey
():
string
{
return
'Toast2'
}
toastLabel
:
eui
.
Label
;
toastLabel
:
eui
.
Label
;
start
()
{
this
.
touchEnabled
=
false
;
// this.touchChildren=false;
this
.
toastLabel
.
textFlow
=
(
new
HtmlTextParser
).
parser
(
'<u>继续闯关赢好礼</u>'
);
this
.
toastLabel
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,()
=>
{
if
(
SceneCtrl
.
instance
.
currentScene
instanceof
MainScene
){
this
.
toastLabel
.
textFlow
=
(
new
HtmlTextParser
).
parser
(
'<u>继续闯关赢好礼</u>'
);
if
(
!
this
.
hasEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
))
{
this
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
if
(
SceneCtrl
.
instance
.
currentScene
instanceof
MainScene
)
{
}
else
{
gotoNextLevel
();
}
egret
.
Tween
.
removeTweens
(
this
);
this
.
alpha
=
0
;
this
.
touchEnabled
=
false
;
this
.
touchChildren
=
false
;
},
this
);
}
}
else
{
gotoNextLevel
();
}
egret
.
Tween
.
removeTweens
(
this
);
this
.
alpha
=
0
;
},
this
);
return
this
;
}
}
\ No newline at end of file
egret/libs/new_wx/ctrls/toastCtrl2.ts
View file @
22510841
...
...
@@ -20,8 +20,13 @@ const initToast = () => {
export
const
showToast2
=
()
=>
{
const
toast
=
initToast
().
start
();
egret
.
Tween
.
removeTweens
(
toast
);
toast
.
touchEnabled
=
true
;
toast
.
touchChildren
=
true
;
const
tw
=
egret
.
Tween
.
get
(
toast
);
tw
.
set
({
y
:
-
200
,
alpha
:
1
}).
to
({
y
:
400
},
500
,
egret
.
Ease
.
quartOut
)
.
wait
(
3500
)
.
to
({
alpha
:
0
},
300
)
.
to
({
alpha
:
0
},
300
).
call
(()
=>
{
toast
.
touchEnabled
=
false
;
toast
.
touchChildren
=
false
;
})
}
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