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
0009ac82
Commit
0009ac82
authored
Aug 21, 2019
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
279a5f09
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
16 deletions
+45
-16
ele6.png
egret/resource/assets/mainScene/ele6.png
+0
-0
MainScene.ts
egret/src/mainScene/MainScene.ts
+11
-4
Chapters.ts
egret/src/something/Chapters.ts
+1
-1
ImageAni.ts
egret/src/something/class/ImageAni.ts
+32
-11
GuideMsg.ts
egret/src/something/uis/GuideMsg.ts
+1
-0
No files found.
egret/resource/assets/mainScene/ele6.png
View replaced file @
279a5f09
View file @
0009ac82
8.3 KB
|
W:
|
H:
10.2 KB
|
W:
|
H:
2-up
Swipe
Onion skin
egret/src/mainScene/MainScene.ts
View file @
0009ac82
...
...
@@ -253,13 +253,16 @@ export default class MainScene extends Scene {
for
(
let
i
=
0
;
i
<
svgas
.
length
;
i
++
)
{
parser
.
load
(
resPath
+
'resource/assets/svgas/'
+
svgas
[
i
]
+
".svga"
,
(
videoItem
)
=>
{
var
mv
=
new
window
[
"SVGA"
].
EgretMovieClip
(
videoItem
);
mv
.
lockStep
=
true
;
mv
.
x
=
(
750
-
520
)
/
2
;
mv
.
y
=
500
;
mv
.
stop
();
let
fun
;
mv
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
fun
=
function
(
e
)
{
e
.
target
.
stop
()
this
.
removeChild
(
e
.
target
)
if
(
e
.
target
.
parent
){
this
.
removeChild
(
e
.
target
)
}
},
this
)
this
.
movieClips
[
svgas
[
i
]]
=
mv
;
},
function
(
error
)
{
...
...
@@ -596,10 +599,9 @@ export default class MainScene extends Scene {
//购买弹框
PanelCtrl
.
instance
.
show
(
"Buy3"
,
{})
}
else
{
//再写
//再写
,成功后请求home接口,然后执行updateScene
NetManager
.
ins
.
hc_useProp
((
s
)
=>
{
if
(
s
){
if
(
s
)
{
}
},
PropType
.
CHANCE_NUM
)
}
...
...
@@ -1860,6 +1862,11 @@ export default class MainScene extends Scene {
if
(
sv
&&
this
.
movieClips
[
sv
])
{
this
.
addChild
(
this
.
movieClips
[
sv
])
this
.
movieClips
[
sv
].
gotoAndPlay
(
1
,
true
)
setTimeout
(()
=>
{
if
(
this
.
movieClips
[
sv
].
parent
){
this
.
removeChild
(
this
.
movieClips
[
sv
])
}
},
667
)
}
this
.
oneStepScore
=
0
;
}
...
...
egret/src/something/Chapters.ts
View file @
0009ac82
...
...
@@ -35,7 +35,7 @@ export const Chapters: ChapterData[] = [
],
connectedLats
:
[[
27
,
45
],
[
28
,
46
],
[
29
,
47
]]
},
baseElementTypes
:
[
0
,
1
,
2
,
3
],
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
effectInitProbability
:
0.15
,
stepCount
:
30
,
passTarget
:
{
...
...
egret/src/something/class/ImageAni.ts
View file @
0009ac82
...
...
@@ -2,6 +2,7 @@
/**
* 直接通过替换source替换图片的动画帧
* 暂时这些动画帧只播放一次,所以简化
* 默认按时间间隔播放
* 图片都以素材为中心为原点
*/
export
class
ImageAni
extends
eui
.
Image
{
...
...
@@ -10,6 +11,11 @@ export class ImageAni extends eui.Image {
totalFrames
:
number
;
isPlay
:
boolean
;
startTime
:
number
/**
* 所有时间,帧数按每秒30
*/
allTime
:
number
/**
* 播放完的回调
*/
...
...
@@ -28,22 +34,36 @@ export class ImageAni extends eui.Image {
this
.
currentFrame
=
0
;
this
.
totalFrames
=
sourceAll
.
length
;
this
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
)
}
this
.
allTime
=
this
.
sourceAll
.
length
/
30
*
1000
;
}
//需要做锁步
private
count
=
0
;
onEnterFrame
()
{
if
(
!
this
.
isPlay
)
{
this
.
count
=
0
//
this.count = 0
return
}
this
.
count
++
;
if
(
this
.
count
%
2
==
0
)
{
this
.
currentFrame
++
;
if
(
this
.
currentFrame
==
this
.
totalFrames
/*-1*/
)
{
this
.
currentFrame
=
0
;
this
.
isPlay
=
false
this
.
callback
&&
this
.
callback
();
}
// this.count++;
// if (this.count % 2 == 0) {
// this.currentFrame++;
// if (this.currentFrame == this.totalFrames/*-1*/) {
// this.currentFrame = 0;
// this.isPlay = false
// this.callback && this.callback();
// }
// this.texture = RES.getRes(this.sourceAll[this.currentFrame])
// this.x = -this.texture.textureWidth / 2;
// this.y = -this.texture.textureHeight / 2;
// }
var
dataNow
=
Date
.
now
();
var
deltaTime
=
dataNow
-
this
.
startTime
;
var
scale
=
deltaTime
/
this
.
allTime
;
if
(
scale
>=
1
)
{
this
.
isPlay
=
false
this
.
callback
&&
this
.
callback
();
}
else
{
this
.
currentFrame
=
(
scale
*
this
.
sourceAll
.
length
)
>>
0
;
this
.
texture
=
RES
.
getRes
(
this
.
sourceAll
[
this
.
currentFrame
])
this
.
x
=
-
this
.
texture
.
textureWidth
/
2
;
this
.
y
=
-
this
.
texture
.
textureHeight
/
2
;
...
...
@@ -54,7 +74,8 @@ export class ImageAni extends eui.Image {
* 回调是播放完后做回收用的
*/
play
(
callback
)
{
this
.
isPlay
=
true
this
.
startTime
=
Date
.
now
();
this
.
isPlay
=
true
;
this
.
currentFrame
=
0
;
this
.
texture
=
RES
.
getRes
(
this
.
sourceAll
[
this
.
currentFrame
])
this
.
x
=
-
this
.
texture
.
textureWidth
/
2
;
...
...
egret/src/something/uis/GuideMsg.ts
View file @
0009ac82
...
...
@@ -62,6 +62,7 @@ export class GuideMsg extends egret.DisplayObjectContainer {
}
else
{
parser
.
load
(
resPath
+
'resource/assets/svgas/'
+
'guide'
+
num
+
'.svga'
,
(
videoItem
)
=>
{
var
mv
=
new
window
[
"SVGA"
].
EgretMovieClip
(
videoItem
);
mv
.
lockStep
=
true
;
mv
.
x
=
3
;
mv
.
y
=
-
263
;
this
.
moiveClip
=
mv
;
...
...
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