Commit 7fc7c516 authored by Tt's avatar Tt

修复bug

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