Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
svge-egret
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
王剑峰
svge-egret
Commits
86196e48
Commit
86196e48
authored
Oct 17, 2019
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
3e032468
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
20 deletions
+25
-20
svga.egret.min.js
build/svga.egret.min.js
+1
-1
MovieClip.js
src/Egret/MovieClip.js
+3
-11
show.html
tests/show.html
+21
-8
No files found.
build/svga.egret.min.js
View file @
86196e48
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/Egret/MovieClip.js
View file @
86196e48
...
...
@@ -161,17 +161,9 @@ export class MovieClip extends egret.DisplayObjectContainer {
for
(
var
i
=
0
,
len
=
sprites
.
length
;
i
<
len
;
i
++
)
{
var
ele
=
sprites
[
i
];
if
(
ele
.
imageKey
)
{
var
child
var
splitArr
=
ele
.
imageKey
.
split
(
"_"
);
//需要标记的,预留其他类型
if
(
splitArr
[
1
]
&&
splitArr
[
1
]
==
"spr"
)
{
child
=
new
egret
.
Bitmap
(
this
.
textures
[
ele
.
imageKey
]);
this
[
splitArr
[
0
]]
=
child
;
}
//一般不需要标记的
else
{
child
=
new
egret
.
Bitmap
(
this
.
textures
[
ele
.
imageKey
]);
}
var
child
=
new
egret
.
Bitmap
(
this
.
textures
[
ele
.
imageKey
]);
//加个名字,暂时用imageKey,如果有一致的imageKey,会覆盖
this
[
ele
.
imageKey
]
=
child
;
//透明度处理
if
(
ele
.
frames
[
0
].
alpha
<
0.05
)
{
child
.
visible
=
false
;
...
...
tests/show.html
View file @
86196e48
...
...
@@ -67,34 +67,47 @@
function
aaa
(
videoItem
)
{
var
obj
=
{};
//帧率 60 30 等
obj
.
FPS
=
videoItem
.
FPS
;
//帧数 81等
obj
.
frames
=
videoItem
.
frames
;
//尺寸
obj
.
videoSize
=
videoItem
.
videoSize
;
//所有的部件
obj
.
sprites
=
[];
for
(
var
i
=
0
;
i
<
videoItem
.
sprites
.
length
;
i
++
)
{
var
sprite
=
videoItem
.
sprites
[
i
];
var
s
=
{};
//图片键值
s
.
imageKey
=
sprite
.
imageKey
;
//动画帧数据组
s
.
frames
=
[];
for
(
var
j
=
0
;
j
<
sprite
.
frames
.
length
;
j
++
)
{
var
frame
=
sprite
.
frames
[
j
];
var
f
=
{};
f
.
alpha
=
frame
.
alpha
;
//透明度
f
.
alpha
=
cutFour
(
frame
.
alpha
);
//矩阵数据,考虑用对象还是数组
f
.
transform
=
[
frame
.
transform
.
a
,
frame
.
transform
.
b
,
frame
.
transform
.
c
,
frame
.
transform
.
d
,
frame
.
transform
.
tx
,
frame
.
transform
.
ty
,
cutFour
(
frame
.
transform
.
a
)
,
cutFour
(
frame
.
transform
.
b
)
,
cutFour
(
frame
.
transform
.
c
)
,
cutFour
(
frame
.
transform
.
d
)
,
cutFour
(
frame
.
transform
.
tx
)
,
cutFour
(
frame
.
transform
.
ty
)
,
];
s
.
frames
.
push
(
f
)
}
obj
.
sprites
.
push
(
s
)
}
// obj.sprites = videoItem.sprites
return
obj
}
function
cutFour
(
number
)
{
var
reg
=
/^
(
.*
\.
.
{4})
.*$/
;
var
temp
=
String
(
number
).
replace
(
reg
,
"$1"
);
return
Number
(
temp
);
}
</script>
</body>
...
...
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