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
eafaa47d
Commit
eafaa47d
authored
Mar 27, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增svg资源
parent
8783010d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
Element.ts
egret/src/something/class/Element.ts
+19
-2
No files found.
egret/src/something/class/Element.ts
View file @
eafaa47d
...
@@ -304,6 +304,9 @@ export class Element extends eui.Component {
...
@@ -304,6 +304,9 @@ export class Element extends eui.Component {
* 显示的图片,直接改source,"ele"+type
* 显示的图片,直接改source,"ele"+type
*/
*/
protected
showImage
:
eui
.
Image
;
protected
showImage
:
eui
.
Image
;
protected
cannobox
:
eui
.
Group
;
cannoboxwid
:
number
=
116
;
cannoboxhei
:
number
=
116
;
temEffectType
:
EffectType
=
null
;
temEffectType
:
EffectType
=
null
;
/**
/**
...
@@ -421,6 +424,14 @@ export class Element extends eui.Component {
...
@@ -421,6 +424,14 @@ export class Element extends eui.Component {
this
.
changeSource
(
"ele"
+
this
.
type
+
"_png"
);
this
.
changeSource
(
"ele"
+
this
.
type
+
"_png"
);
this
.
addChild
(
this
.
showImage
);
this
.
addChild
(
this
.
showImage
);
this
.
cannobox
=
new
eui
.
Group
();
this
.
cannobox
.
width
=
this
.
cannoboxwid
;
this
.
cannobox
.
height
=
this
.
cannoboxhei
;
this
.
cannobox
.
anchorOffsetX
=
this
.
cannoboxwid
/
2
;
this
.
cannobox
.
anchorOffsetY
=
this
.
cannoboxhei
/
2
;
this
.
addChild
(
this
.
cannobox
);
this
.
cannolab
=
new
eui
.
Label
();
this
.
cannolab
=
new
eui
.
Label
();
this
.
cannolab
.
size
=
30
;
this
.
cannolab
.
size
=
30
;
this
.
cannolab
.
textColor
=
0xff0000
;
this
.
cannolab
.
textColor
=
0xff0000
;
...
@@ -428,7 +439,7 @@ export class Element extends eui.Component {
...
@@ -428,7 +439,7 @@ export class Element extends eui.Component {
this
.
cannolab
.
y
=
0
;
this
.
cannolab
.
y
=
0
;
this
.
addChild
(
this
.
cannolab
);
this
.
addChild
(
this
.
cannolab
);
this
.
cannolab
.
visible
=
type
==
ElementType
.
CANNO
;
this
.
canno
box
.
visible
=
this
.
canno
lab
.
visible
=
type
==
ElementType
.
CANNO
;
this
.
showImage
.
visible
=
type
!=
ElementType
.
CANNO
;
this
.
showImage
.
visible
=
type
!=
ElementType
.
CANNO
;
//鸡蛋
//鸡蛋
if
(
type
==
ElementType
.
CHICKEN_EGG
)
{
if
(
type
==
ElementType
.
CHICKEN_EGG
)
{
...
@@ -466,9 +477,15 @@ export class Element extends eui.Component {
...
@@ -466,9 +477,15 @@ export class Element extends eui.Component {
svgaParser
.
load
(
resPath
+
'resource/assets/svgas/canno.svga'
,
(
videoItem
)
=>
{
svgaParser
.
load
(
resPath
+
'resource/assets/svgas/canno.svga'
,
(
videoItem
)
=>
{
this
.
cannoMoveClip
=
new
window
[
"SVGA"
].
EgretMovieClip
(
videoItem
);
this
.
cannoMoveClip
=
new
window
[
"SVGA"
].
EgretMovieClip
(
videoItem
);
this
.
cannoMoveClip
.
lockStep
=
true
;
this
.
cannoMoveClip
.
lockStep
=
true
;
this
.
cannoMoveClip
.
x
=
0
;
var
mvwidth
=
102
;
var
mvheight
=
116
;
this
.
cannoMoveClip
.
x
=
(
this
.
cannoboxwid
-
mvwidth
)
/
2
;
this
.
cannoMoveClip
.
y
=
0
;
this
.
cannoMoveClip
.
y
=
0
;
this
.
cannobox
.
addChild
(
this
.
cannoMoveClip
);
console
.
log
(
"paotai"
,
this
.
cannoMoveClip
);
console
.
log
(
"paotai"
,
this
.
cannoMoveClip
);
});
});
}
}
}
}
...
...
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