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

添加教师头像进入动画

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