Commit c7976f06 authored by linzhiguo's avatar linzhiguo

# 选项位置

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