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
c1fc2956
Commit
c1fc2956
authored
Apr 03, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
89af0506
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
50 deletions
+39
-50
box.svga
egret/resource/assets/svgas/box.svga
+0
-0
MapSkin.exml
egret/resource/skins/MapSkin.exml
+2
-2
MapScene.ts
egret/src/mapScene/MapScene.ts
+26
-29
svgaTool.ts
egret/src/panels/help/svgaTool.ts
+11
-19
No files found.
egret/resource/assets/svgas/box.svga
View file @
c1fc2956
No preview for this file type
egret/resource/skins/MapSkin.exml
View file @
c1fc2956
...
...
@@ -225,9 +225,9 @@
</e:Group>
<e:Group
id=
"boxLayer"
x=
"0"
y=
"0"
visible=
"false"
>
<e:Rect
width=
"750"
height=
"1624"
fillAlpha=
"0.7"
x=
"0"
y=
"0"
/>
<e:Group
id=
"boxani"
>
<e:Group
id=
"boxani"
width=
"750"
height=
"1624"
>
<e:Image
source=
"common_box_btn_png"
y=
"957.41"
x=
"189"
scaleX=
"1"
scaleY=
"1"
/>
</e:Group>
<e:Label
text=
"点击开宝箱"
y=
"791"
size=
"37"
horizontalCenter=
"0"
bold=
"true"
/>
</e:Group>
<e:Group
id=
"guide"
visible=
"false"
locked=
"true"
>
<e:Rect
width=
"750"
height=
"1624"
x=
"0"
y=
"0"
alpha=
"0.7"
/>
...
...
egret/src/mapScene/MapScene.ts
View file @
c1fc2956
...
...
@@ -37,6 +37,7 @@ import getIconGroup from "./getIconGroup";
import
getSignBtn
from
"./getSignBtn"
;
import
getAdBtn
from
"./getAdBtn"
;
import
getInviteBtn
from
"./getInviteBtn"
;
import
{
play2
,
play1
}
from
"../panels/help/svgaTool"
;
let
doHelpFlag
=
false
;
// let doScratchHelpFlag = false;
...
...
@@ -87,6 +88,8 @@ export default class MapScene extends Scene {
parmas
.
push
({
netCallback
:
netCallback
,
code
:
code
});
}
return
true
;
// play2()
}
// 邀请有礼角标倒计时
...
...
@@ -1035,56 +1038,50 @@ export default class MapScene extends Scene {
}
private
_mc
;
private
stopFunc
;
async
onTap_boxLayer
()
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
1
));
const
data
=
getHomeData
();
if
(
data
.
canReceiveTreasureBoxNum
>
0
)
{
this
[
'boxLayer'
].
visible
=
true
;
this
[
'boxani'
].
y
=
this
.
stage
.
stageHeight
/
2
-
1624
/
2
;
if
(
!
this
.
_mc
)
this
.
_mc
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/box.svga'
,
this
[
'boxani'
]);
this
.
_mc
.
stop
();
this
.
_mc
.
gotoAndStop
(
1
);
this
.
_mc
.
anchorOffsetX
=
750
/
2
;
this
.
_mc
.
anchorOffsetY
=
500
+
50
+
30
;
this
.
_mc
.
x
=
750
/
2
;
this
.
_mc
.
y
=
500
+
50
+
30
;
//
this._mc.stop();
//
this._mc.gotoAndStop(1);
//
this._mc.anchorOffsetX = 750 / 2;
//
this._mc.anchorOffsetY = 500 + 50 + 30;
//
this._mc.x = 750 / 2;
//
this._mc.y = 500 + 50 + 30;
this
.
_mc
.
visible
=
false
;
await
wait
(
50
);
this
.
_mc
.
visible
=
true
;
const
a
=
100
,
b
=
10
;
egret
.
Tween
.
get
(
this
.
_mc
,
{
loop
:
true
}).
set
({
rotation
:
b
})
.
to
({
rotation
:
-
b
},
a
).
to
({
rotation
:
b
},
a
)
.
to
({
rotation
:
-
b
},
a
).
to
({
rotation
:
b
},
a
)
.
to
({
rotation
:
-
b
},
a
).
to
({
rotation
:
b
},
a
)
.
to
({
rotation
:
0
},
a
/
2
)
.
wait
(
1000
);
this
.
stopFunc
=
play1
(
this
.
_mc
,
1
,
120
);
}
}
async
playAni
()
{
if
(
this
.
_mc
)
{
egret
.
Tween
.
removeTweens
(
this
.
_mc
);
this
.
_mc
.
gotoAndPlay
(
1
,
true
);
await
this
.
onPlaySTOP
();
await
play2
(
this
.
_mc
,
121
,
240
);
}
this
[
'boxLayer'
].
visible
=
false
;
}
async
onPlaySTOP
()
{
return
new
Promise
((
r
)
=>
{
const
func
=
()
=>
{
if
(
this
.
_mc
.
currentFrame
>=
100
)
{
this
.
_mc
.
removeEventListener
(
egret
.
Event
.
ENTER_FRAME
,
func
,
this
);
this
.
_mc
.
stop
();
r
();
}
}
this
.
_mc
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
func
,
this
);
});
}
//
async onPlaySTOP() {
//
return new Promise((r) => {
//
const func = () => {
//
if (this._mc.currentFrame >= 100) {
//
this._mc.removeEventListener(egret.Event.ENTER_FRAME, func, this);
//
this._mc.stop();
//
r();
//
}
//
}
//
this._mc.addEventListener(egret.Event.ENTER_FRAME, func, this);
//
});
//
}
async
onTap_box
()
{
console
.
log
(
1
)
...
...
egret/src/panels/help/svgaTool.ts
View file @
c1fc2956
//播放完之后,在一个区间循环
// export const play1 = (mv, start, end, loopStart, loopEnd) => {
// const func1 = () => {
// if (mv.currentFrame == end)
// };
// mv.gotoAndPlay(start);
// mv.addEventListener(egret.Event.ENTER_FRAME, func1, this);
// mv.addEventListener(egret.Event.ENTER_FRAME, () => {
// if (this.mv1.currentFrame == this.mv1_end)
// this.mv1.gotoAndPlay(this.mv1_start);
// if (this.mv1.currentFrame == 420) {
// this.mv1_start = 421;
// this.mv1_end = this.mv1.totalFrames;
// }
// }, this);
// }
export
const
play1
=
(
mv
,
loopStart
,
loopEnd
)
=>
{
const
func1
=
()
=>
{
if
(
mv
.
currentFrame
==
loopEnd
)
mv
.
gotoAndPlay
(
loopStart
);
};
mv
.
gotoAndPlay
(
loopStart
);
mv
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
func1
,
this
);
return
()
=>
{
mv
.
removeEventListener
(
egret
.
Event
.
ENTER_FRAME
,
func1
,
this
);
}
}
...
...
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