Commit 553e3a9d authored by limingzhe's avatar limingzhe

fix: debug

parent 14fb643f
This diff is collapsed.
...@@ -488,7 +488,9 @@ cc.Class({ ...@@ -488,7 +488,9 @@ cc.Class({
this.playCatAudio(this.data.begin_audio_url, () => { this.playCatAudio(this.data.begin_audio_url, () => {
this.canTouch = true; this.canTouch = true;
// this.isPanelMoveEnd = true; // this.isPanelMoveEnd = true;
this.startTesting();
this.catBeginEnd = true;
this.checkStart();
}); });
this.curCatAudioUrl = this.data.idle_audio_url; this.curCatAudioUrl = this.data.idle_audio_url;
...@@ -603,7 +605,7 @@ cc.Class({ ...@@ -603,7 +605,7 @@ cc.Class({
checkStart() { checkStart() {
console.log(' in checkStart') console.log(' in checkStart')
if (this.debugBgImg && this.hzLoadEnd) { if (this.debugBgImg && this.hzLoadEnd && this.catBeginEnd) {
this.startTesting(); this.startTesting();
} }
...@@ -5762,7 +5764,7 @@ cc.Class({ ...@@ -5762,7 +5764,7 @@ cc.Class({
initBg() { initBg() {
console.log("this.data.bg_pic_url: ", this.data.bg_pic_url); console.log("this.data.bg_pic_url: ", this.data.bg_pic_url);
const bg = getSprNode('bg'); const bg = getSprNode('bg');
const scaleX = this.canvas.width / bg.width const scaleX = this.canvas.width / bg.width
const scaleY = this.canvas.height / bg.height const scaleY = this.canvas.height / bg.height
...@@ -5781,7 +5783,6 @@ cc.Class({ ...@@ -5781,7 +5783,6 @@ cc.Class({
hotZoneBg: null, hotZoneBg: null,
initHotZoneBg() { initHotZoneBg() {
this.hotZoneBg = new cc.Node(); this.hotZoneBg = new cc.Node();
this.hotZoneBg.name = 'hotZoneBg'; this.hotZoneBg.name = 'hotZoneBg';
this.hotZoneBg.parent = cc.find('Canvas'); this.hotZoneBg.parent = cc.find('Canvas');
this.hotZoneBg.zIndex = 4; this.hotZoneBg.zIndex = 4;
...@@ -5798,7 +5799,6 @@ cc.Class({ ...@@ -5798,7 +5799,6 @@ cc.Class({
this.hotZoneBg.height = img.height; this.hotZoneBg.height = img.height;
const sprNode = new cc.Node(); const sprNode = new cc.Node();
sprNode.name = 'bgItemSpr' sprNode.name = 'bgItemSpr'
var sf = new cc.SpriteFrame(img); var sf = new cc.SpriteFrame(img);
...@@ -5811,19 +5811,40 @@ cc.Class({ ...@@ -5811,19 +5811,40 @@ cc.Class({
window['bg'] =sprNode window['bg'] =sprNode
const sx = this.canvas.width / this.hotZoneBg.width; // const sx = this.canvas.width / this.hotZoneBg.width;
const sy = (this.canvas.height) / this.hotZoneBg.height; // const sy = (this.canvas.height) / this.hotZoneBg.height;
// const s = Math.min(sx, sy);
// this.hotZoneBg.scale = s;
const panel = getSprNode('panel');
panel.scale = this._mapScaleMin * 1.5;
this.canvas.addChild(panel);
panel.x = -this.canvas.width;
const parent = panel;
const sx = parent.width / this.hotZoneBg.width;
const sy = parent.height / this.hotZoneBg.height;
const s = Math.min(sx, sy); const s = Math.min(sx, sy);
this.hotZoneBg.scale = s;
this.hotZoneBg.scale = s * 0.9;
this.hotZoneBg.parent = panel;
// this.data.bgItem.isShowDebugLine = true; // this.data.bgItem.isShowDebugLine = true;
this.initHotZoneItem(); this.initHotZoneItem();
this.hzLoadEnd = true;
this.checkStart();
cc.tween(panel)
.to(1, {x: 0}, {easing: 'cubicOut'})
.call(() => {
this.hzLoadEnd = true;
this.checkStart();
})
.start();
}); });
}, },
......
...@@ -81,6 +81,7 @@ export function getSpriteFrimeByUrl(url, cb) { ...@@ -81,6 +81,7 @@ export function getSpriteFrimeByUrl(url, cb) {
} }
export function getSprNode(resName) { export function getSprNode(resName) {
console.log('getSprNode name: ', resName);
const sf = cc.find('Canvas/res/img/' + resName).getComponent(cc.Sprite).spriteFrame; const sf = cc.find('Canvas/res/img/' + resName).getComponent(cc.Sprite).spriteFrame;
const node = new cc.Node(); const node = new cc.Node();
node.addComponent(cc.Sprite).spriteFrame = sf; node.addComponent(cc.Sprite).spriteFrame = sf;
......
{
"ver": "2.3.5",
"uuid": "bb7834e2-2860-44ab-b61a-7cbb95e196eb",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 900,
"height": 510,
"platformSettings": {},
"subMetas": {
"panel": {
"ver": "1.0.4",
"uuid": "3e3af191-f7fb-4e1d-9de3-c629f1af6da3",
"rawTextureUuid": "bb7834e2-2860-44ab-b61a-7cbb95e196eb",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 900,
"height": 510,
"rawWidth": 900,
"rawHeight": 510,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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