Commit 6886bf74 authored by Tt's avatar Tt

修改图片坐标

parent 089e2235
...@@ -3796,7 +3796,7 @@ ...@@ -3796,7 +3796,7 @@
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
"_target": null, "_target": null,
"_alignFlags": 40, "_alignFlags": 0,
"_left": 0, "_left": 0,
"_right": 0, "_right": 0,
"_top": 513, "_top": 513,
......
...@@ -203,6 +203,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -203,6 +203,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
private currentTime: number; private currentTime: number;
private currentItemQuestion: cc.Node; private currentItemQuestion: cc.Node;
private nextItemQuestion: cc.Node; private nextItemQuestion: cc.Node;
private defaultPos: cc.Vec2;
startQuestion() { startQuestion() {
// 游戏所需的初始化数据 // 游戏所需的初始化数据
this.currentId = 0 this.currentId = 0
...@@ -212,7 +213,8 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -212,7 +213,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.right = 0 this.right = 0
this.gameStart = true; this.gameStart = true;
this.state = State.Recording; this.state = State.Recording;
this.currentItemQuestion = this.createQuestionItem(cc.v2(0, -100)); this.defaultPos = cc.v2(0, -100);
this.currentItemQuestion = this.createQuestionItem(this.defaultPos);
this.updateQuestion(this.currentItemQuestion, this.getCurrent()); this.updateQuestion(this.currentItemQuestion, this.getCurrent());
this.updateProgress(); this.updateProgress();
} }
...@@ -240,11 +242,11 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -240,11 +242,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
return; return;
} }
this.hideAnswer(); this.hideAnswer();
this.nextItemQuestion = this.createQuestionItem(cc.v2(2000, 50)); this.nextItemQuestion = this.createQuestionItem(cc.v2(2000, this.defaultPos.y));
this.updateQuestion(this.nextItemQuestion, this.getCurrent()); this.updateQuestion(this.nextItemQuestion, this.getCurrent());
pg.hw.playLocalAudio('showCard') pg.hw.playLocalAudio('showCard')
cc.tween(this.currentItemQuestion).to(0.5, { x: -2000, y: 50 }).start(); cc.tween(this.currentItemQuestion).to(0.5, { x: -2000, y: this.defaultPos.y }).start();
cc.tween(this.nextItemQuestion).to(0.5, { x: 0, y: 50 }).call(() => { cc.tween(this.nextItemQuestion).to(0.5, { x: 0, y: this.defaultPos.y }).call(() => {
this.currentItemQuestion.parent = null; this.currentItemQuestion.parent = null;
this.currentItemQuestion = this.nextItemQuestion; this.currentItemQuestion = this.nextItemQuestion;
this.nextItemQuestion = null; this.nextItemQuestion = null;
......
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