Commit 7fc7c516 authored by Tt's avatar Tt

修复bug

parent abf65db8
......@@ -3038,8 +3038,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 286,
"height": 232
"width": 232,
"height": 189
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -3198,8 +3198,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 270,
"height": 180
"width": 210,
"height": 140
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -3211,7 +3211,7 @@
"ctor": "Float64Array",
"array": [
0,
0,
5,
0,
0,
0,
......@@ -5017,7 +5017,7 @@
"ctor": "Float64Array",
"array": [
823.5,
-16.021,
54.695,
0,
0,
0,
......
......@@ -95,7 +95,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.img_dengpao.opacity = 100;
let img = pg.view.find(this.layout_canvas, 'img');
pg.view.setNetImg(img, this.currentQuestion.bgItem.url, { w: 1220, h: 790 }, false)
pg.view.setNetImg(img, this.currentQuestion.bgItem.url, { w: 1220, h: 790 }, true)
if (this.current == 0) {
this.playLocalAudio('opendoor')
......@@ -203,7 +203,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
} else if (data.itemType == 'pic') {
let item = pg.view.clone(this.item_battery_img)
let item_img = pg.view.find(item, 'item_img');
pg.view.setNetImg(pg.view.find(item_img, 'img'), data.pic_url, { w: 270, h: 180 }, true)
pg.view.setNetImg(pg.view.find(item_img, 'img'), data.pic_url, { w: 210, h: 140 }, true)
item.active = true;
item.x = 0;
if (!lastY && lastY != 0) lastY = orgPosY;
......@@ -299,18 +299,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
private changepoints(data) {
let scX = 1220 / data.bgItem.rect.width;
let scY = 790 / data.bgItem.rect.height;
let px = data.bgItem.rect.x;
let py = data.bgItem.rect.y;
let scaleX = 1220 / data.bgItem.rect.width;
let scaleY = 790 / data.bgItem.rect.height;
let scale = scaleX <= scaleY ? scaleX : scaleY;
return data.hotZoneItemArr.map((item, idx) => {
let rect = item.rect;
item.pos = {
x: (rect.x + (rect.width / 2)) * scX,
y: -((rect.y + (rect.height / 2)) * scY)
x: (rect.x + (rect.width / 2)) * scale,
y: -((rect.y + (rect.height / 2)) * scale)
}
item.width = rect.width * scX;
item.height = rect.height * scY;
item.width = rect.width * scale;
item.height = rect.height * scale;
return item;
})
}
......@@ -400,13 +399,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
showXiaodi() {
if (!this.data.npcAudioEnd) return;
pg.view.find(this, 'layout_xiaodi/btn_go').active = false;
if (this.data.npcAudioText) {
if (this.data.npcTitle) {
this.scheduleOnce(() => {
pg.view.find(this, 'layout_xiaodi/btn_go').active = true;
}, 0.5)
}
pg.view.touchOn(pg.view.find(this, 'layout_xiaodi/btn_go'), this.onTouchExit, this);
pg.view.setString(pg.view.find(this, 'layout_xiaodi/btn_go/txt'), this.data.npcTitle)
pg.view.setString(pg.view.find(this, 'layout_xiaodi/btn_go/text'), this.data.npcTitle)
pg.view.find(this, 'layout_xiaodi').active = true;
pg.view.find(this, 'layout_xiaodi').getComponent(dg_xiaodi).playOver(this.data.npcAudioEnd)
}
......
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