Commit c7976f06 authored by linzhiguo's avatar linzhiguo

# 选项位置

#
parent 8f00e4e1
...@@ -556,19 +556,19 @@ ...@@ -556,19 +556,19 @@
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 1280, "width": 1280,
"height": 530 "height": 540
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": 0, "x": 0,
"y": 0.5 "y": 0.55
}, },
"_trs": { "_trs": {
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-640, -640,
92, 117,
0, 0,
0, 0,
0, 0,
...@@ -660,11 +660,11 @@ ...@@ -660,11 +660,11 @@
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
"_target": null, "_target": null,
"_alignFlags": 41, "_alignFlags": 45,
"_left": 0, "_left": 0,
"_right": 0, "_right": 0,
"_top": 3.0000000000000036, "_top": 0,
"_bottom": 0, "_bottom": 180,
"_verticalCenter": 0, "_verticalCenter": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_isAbsLeft": true, "_isAbsLeft": true,
...@@ -674,7 +674,7 @@ ...@@ -674,7 +674,7 @@
"_isAbsHorizontalCenter": true, "_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true, "_isAbsVerticalCenter": true,
"_originalWidth": 1277, "_originalWidth": 1277,
"_originalHeight": 0, "_originalHeight": 530,
"_id": "70gNgjcRhGR75pT/PBUfxW" "_id": "70gNgjcRhGR75pT/PBUfxW"
}, },
{ {
...@@ -1787,7 +1787,7 @@ ...@@ -1787,7 +1787,7 @@
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 479, "width": 479,
"height": 284 "height": 244
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -4213,7 +4213,7 @@ ...@@ -4213,7 +4213,7 @@
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 450, "width": 450,
"height": 254 "height": 214
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -4287,7 +4287,7 @@ ...@@ -4287,7 +4287,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-135, -135,
67, 47,
0, 0,
0, 0,
0, 0,
...@@ -4381,7 +4381,7 @@ ...@@ -4381,7 +4381,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
25, 25,
67, 47,
0, 0,
0, 0,
0, 0,
...@@ -4475,7 +4475,7 @@ ...@@ -4475,7 +4475,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-135, -135,
-3, -23,
0, 0,
0, 0,
0, 0,
...@@ -4569,7 +4569,7 @@ ...@@ -4569,7 +4569,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
25, 25,
-3, -23,
0, 0,
0, 0,
0, 0,
...@@ -4636,7 +4636,7 @@ ...@@ -4636,7 +4636,7 @@
"_layoutSize": { "_layoutSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 450, "width": 450,
"height": 254 "height": 214
}, },
"_resize": 0, "_resize": 0,
"_N$layoutType": 3, "_N$layoutType": 3,
...@@ -4752,7 +4752,7 @@ ...@@ -4752,7 +4752,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-148, -148,
-120, -64.5,
0, 0,
0, 0,
0, 0,
...@@ -5010,11 +5010,11 @@ ...@@ -5010,11 +5010,11 @@
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
"_target": null, "_target": null,
"_alignFlags": 4, "_alignFlags": 12,
"_left": -19, "_left": -19,
"_right": 0, "_right": 0,
"_top": 194.5, "_top": 194.5,
"_bottom": -45.5, "_bottom": -10,
"_verticalCenter": 0, "_verticalCenter": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_isAbsLeft": true, "_isAbsLeft": true,
...@@ -5075,7 +5075,7 @@ ...@@ -5075,7 +5075,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-97, -97,
-149, -93.5,
0, 0,
0, 0,
0, 0,
...@@ -5336,11 +5336,11 @@ ...@@ -5336,11 +5336,11 @@
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
"_target": null, "_target": null,
"_alignFlags": 4, "_alignFlags": 12,
"_left": -27, "_left": -27,
"_right": 0, "_right": 0,
"_top": 252.5, "_top": 252.5,
"_bottom": -45.5, "_bottom": -10,
"_verticalCenter": 0, "_verticalCenter": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_isAbsLeft": true, "_isAbsLeft": true,
...@@ -5413,7 +5413,7 @@ ...@@ -5413,7 +5413,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-208, -208,
133.23200000000003, 113.23200000000003,
0, 0,
0, 0,
0, 0,
...@@ -6213,7 +6213,7 @@ ...@@ -6213,7 +6213,7 @@
"__uuid__": "cd38cebe-aadb-4dd7-a641-aec306af5ad6" "__uuid__": "cd38cebe-aadb-4dd7-a641-aec306af5ad6"
}, },
"_type": 1, "_type": 1,
"_sizeMode": 1, "_sizeMode": 0,
"_fillType": 0, "_fillType": 0,
"_fillCenter": { "_fillCenter": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -6293,7 +6293,7 @@ ...@@ -6293,7 +6293,7 @@
"__id__": 136 "__id__": 136
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 141 "__id__": 141
...@@ -7035,7 +7035,7 @@ ...@@ -7035,7 +7035,7 @@
"__id__": 150 "__id__": 150
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 155 "__id__": 155
......
...@@ -205,13 +205,15 @@ cc.Class({ ...@@ -205,13 +205,15 @@ cc.Class({
this._move_area.height = this._frameSize.height - 260; this._move_area.height = this._frameSize.height - 260;
let h1 = this._frameSize.height - 260 - 216*2; let h1 = this._frameSize.height - 260 - 216*2;
let s1 = h1/3; let s1 = h1/3;
let offy = 216/2 +10; let offy = 216/2;
this._ys = [-offy, offy]; this._ys = [-offy, offy];
// let option_node = cc.find('res/option'); // let option_node = cc.find('res/option');
// let option = option_node.getComponent(cc.js.getClassByName('WordOption')); // let option = option_node.getComponent(cc.js.getClassByName('WordOption'));
this._fg_height = 180;
this._test.on('click', ()=>{ this._test.on('click', ()=>{
}); });
...@@ -297,6 +299,10 @@ cc.Class({ ...@@ -297,6 +299,10 @@ cc.Class({
for(let i = 0; i < len; i++){ for(let i = 0; i < len; i++){
item = this._kind_group.node.children[i]; item = this._kind_group.node.children[i];
if (cc.rect(item.getBoundingBoxToWorld()).intersects(cc.rect(selected.node.getBoundingBoxToWorld()))){ if (cc.rect(item.getBoundingBoxToWorld()).intersects(cc.rect(selected.node.getBoundingBoxToWorld()))){
console.log(i);
console.log(item.getBoundingBoxToWorld());
let kind = item.getComponent(cc.js.getClassByName('WordKind')); let kind = item.getComponent(cc.js.getClassByName('WordKind'));
if (kind.kind_id != selected.kind_id){ if (kind.kind_id != selected.kind_id){
this.playAudioByName('incorrect'); this.playAudioByName('incorrect');
...@@ -367,14 +373,15 @@ cc.Class({ ...@@ -367,14 +373,15 @@ cc.Class({
upForeground(cb){ upForeground(cb){
let fg = cc.find('Canvas/fg'); let fg = cc.find('Canvas/fg');
let fg_top = -this._frameSize.height/2-150; let fg_top = cc.find('Canvas/fg_top').y;
let fg_bottom = fg_top - 160 * this._frameSize.width /1280; //fg_top -= 100;
console.log('bottom = ' + fg_bottom); // let fg_bottom = fg_top - fgh;
// console.log('bottom = ' + fg_bottom);
fg.y = fg_bottom; //fg.y = fg_bottom;
this.playAudioByName('up'); this.playAudioByName('up');
cc.tween(fg) cc.tween(fg)
.to(0.3, {y :fg_top}) .to(0.3, {y :fg.y + this._fg_height})
.call(()=>{ .call(()=>{
this._moved = true; this._moved = true;
cb && cb(); cb && cb();
...@@ -384,11 +391,12 @@ cc.Class({ ...@@ -384,11 +391,12 @@ cc.Class({
downForeground(cb){ downForeground(cb){
let fg = cc.find('Canvas/fg'); let fg = cc.find('Canvas/fg');
let fg_top = -this._frameSize.height/2-150; //let fg_top = cc.find('Canvas/fg_top').y;
let fg_bottom = fg_top - 160 * this._frameSize.width /1280; //fg_top -= 100;
fg.y = fg_top; //let fg_bottom = fg_top - fgh;
//fg.y = fg_top;
cc.tween(fg) cc.tween(fg)
.to(0.3, {y :fg_bottom}) .to(0.3, {y :fg.y-this._fg_height})
.call(()=>{ .call(()=>{
cb && cb(); cb && cb();
}) })
...@@ -683,9 +691,8 @@ cc.Class({ ...@@ -683,9 +691,8 @@ cc.Class({
for(let i = 0; i < area.childrenCount; i++){ for(let i = 0; i < area.childrenCount; i++){
let item = area.children[i]; let item = area.children[i];
item.x += speed; item.x += speed;
if (item.x > this._frameSize.width + item._w/2){
if (item.x > this._frameSize.width + item._w*1.2){ this._xs[i%2] -= item._w/2;
this._xs[i%2] -= item._w*1.2;
//item.x = Math.min(-item._w/2, this._xs[i%2]); //item.x = Math.min(-item._w/2, this._xs[i%2]);
item.x = -item._w/2; item.x = -item._w/2;
} }
......
...@@ -23,7 +23,7 @@ cc.Class({ ...@@ -23,7 +23,7 @@ cc.Class({
this.node.addChild(item); this.node.addChild(item);
kind = item.getComponent(cc.js.getClassByName('WordKind')); kind = item.getComponent(cc.js.getClassByName('WordKind'));
kind.init(data[i]); kind.init(data[i]);
item.y += 43; item.y += 80;
} }
this.updateView(); this.updateView();
......
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