Commit eafaa47d authored by zjz1994's avatar zjz1994

新增svg资源

parent 8783010d
......@@ -304,6 +304,9 @@ export class Element extends eui.Component {
* 显示的图片,直接改source,"ele"+type
*/
protected showImage: eui.Image;
protected cannobox:eui.Group;
cannoboxwid:number = 116;
cannoboxhei:number = 116;
temEffectType: EffectType = null;
/**
......@@ -421,6 +424,14 @@ export class Element extends eui.Component {
this.changeSource("ele" + this.type + "_png");
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.size = 30;
this.cannolab.textColor = 0xff0000;
......@@ -428,7 +439,7 @@ export class Element extends eui.Component {
this.cannolab.y = 0;
this.addChild(this.cannolab);
this.cannolab.visible = type == ElementType.CANNO;
this.cannobox.visible = this.cannolab.visible = type == ElementType.CANNO;
this.showImage.visible = type != ElementType.CANNO;
//鸡蛋
if (type == ElementType.CHICKEN_EGG) {
......@@ -466,9 +477,15 @@ export class Element extends eui.Component {
svgaParser.load(resPath + 'resource/assets/svgas/canno.svga', (videoItem) => {
this.cannoMoveClip = new window["SVGA"].EgretMovieClip(videoItem);
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.cannobox.addChild(this.cannoMoveClip);
console.log("paotai",this.cannoMoveClip);
});
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment