Commit 00d31af4 authored by 李维's avatar 李维

添加教师头像进入动画

parent a75ed69d
......@@ -21218,14 +21218,14 @@
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"x": 0,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-685,
-900,
-410,
0,
0,
......@@ -21280,14 +21280,14 @@
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"x": 0,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-56.184,
0,
0,
0,
0,
......@@ -21372,15 +21372,15 @@
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"x": 0,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
140.459,
9.364,
200,
0,
0,
0,
0,
......@@ -21447,7 +21447,7 @@
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 12,
"_alignFlags": 4,
"_left": 50,
"_right": 0,
"_top": 0,
......
......@@ -78,10 +78,11 @@ export default class MissionPageClass extends PageComponentBaseClass {
const headSprStr = unitConfigData && unitConfigData.teacher_avatar ? unitConfigData.teacher_avatar : "";
if(headSprStr) {
getSprNodeByUrl(headSprStr, (spr) => {
this.headNode.addChild(spr.node);
spr.srcBlendFactor = cc.macro.BlendFactor.ONE;
setSprNodeMaxLen(spr.node, this.headNode.width, this.headNode.height);
this.headNode.active = true;
this.headNode.getComponent(cc.Sprite).spriteFrame = spr.spriteFrame;
spr.node.destroy()
setSprNodeMaxLen(this.headNode, this.headNode.width, this.headNode.height);
this.showHeaderAnimation()
});
}
......@@ -345,6 +346,14 @@ export default class MissionPageClass extends PageComponentBaseClass {
}
}
showHeaderAnimation() {
const width = cc.find("/Canvas").width / 2;
this.headNode.x = -width / 2 - this.headNode.parent.width;
this.headNode.active = true;
cc.tween(this.headNode).to(0.5, {
x: -width / 2 + this.headNode.parent.width
}, { easing: "cubicOut" }).start()
}
onClickOpenLessonPreview() {
this.LessonPreview.active = true
......
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