Commit 462aba26 authored by zjz1994's avatar zjz1994

检查stageHeight的null问题1

parent d4a07c7a
...@@ -3,6 +3,7 @@ import ComponentBase from "./ComponentBase"; ...@@ -3,6 +3,7 @@ import ComponentBase from "./ComponentBase";
export default class Panel extends ComponentBase { export default class Panel extends ComponentBase {
public onShowAnim(){ public onShowAnim(){
console.log("test==Panel");
console.log('panel height',this.height,'stage height',this.stage.stageHeight,'pane skin',this.skinKey); console.log('panel height',this.height,'stage height',this.stage.stageHeight,'pane skin',this.skinKey);
let targetY:number; let targetY:number;
// if(this.skinKey=='Turntable'){ // if(this.skinKey=='Turntable'){
......
...@@ -7,6 +7,7 @@ export default class Scene extends ComponentBase { ...@@ -7,6 +7,7 @@ export default class Scene extends ComponentBase {
start(data?) { start(data?) {
super.start(data); super.start(data);
console.log("test==Scene");
this.height = this.stage.stageHeight; this.height = this.stage.stageHeight;
this.playAnimation(); this.playAnimation();
} }
......
...@@ -10,6 +10,7 @@ export default class H52Scene extends Scene { ...@@ -10,6 +10,7 @@ export default class H52Scene extends Scene {
async start(data?) { async start(data?) {
NetManager.ins.showLog(getlogItem(51)); NetManager.ins.showLog(getlogItem(51));
super.start(); super.start();
// console.log("test==getH52");
this['group'].y = (this.stage.stageHeight -1624)/2 this['group'].y = (this.stage.stageHeight -1624)/2
// this.height=this.stage.stageHeight; // this.height=this.stage.stageHeight;
// this['rulebtn'].addEventListener(egret.TouchEvent.TOUCH_TAP,()=>{ // this['rulebtn'].addEventListener(egret.TouchEvent.TOUCH_TAP,()=>{
......
...@@ -27,9 +27,9 @@ export const getFriendShareUrl = async (parent?: egret.DisplayObjectContainer,ra ...@@ -27,9 +27,9 @@ export const getFriendShareUrl = async (parent?: egret.DisplayObjectContainer,ra
const showoff = new FriendWxShare(); const showoff = new FriendWxShare();
showoff.loadSkin(); showoff.loadSkin();
showoff.start(rank); showoff.start(rank);
console.log("test==getFriendShare");
if (parent) { if (parent) {
parent.addChild(showoff); parent.addChild(showoff);
showoff.y = showoff.stage.stageHeight/2- showoff.height/2; showoff.y = showoff.stage.stageHeight/2- showoff.height/2;
}; };
...@@ -37,6 +37,7 @@ export const getFriendShareUrl = async (parent?: egret.DisplayObjectContainer,ra ...@@ -37,6 +37,7 @@ export const getFriendShareUrl = async (parent?: egret.DisplayObjectContainer,ra
img.style.display = 'block'; img.style.display = 'block';
Loading.instace.show(); Loading.instace.show();
setTimeout(() => { setTimeout(() => {
console.log("test==getFriendShare1");
const base64 = getPrintScreenData(showoff, 0, (showoff.height - showoff.stage.stageHeight)/2, pic.textureWidth, parent.stage.stageHeight); const base64 = getPrintScreenData(showoff, 0, (showoff.height - showoff.stage.stageHeight)/2, pic.textureWidth, parent.stage.stageHeight);
img.src = base64; img.src = base64;
Loading.instace.hide(); Loading.instace.hide();
......
...@@ -34,6 +34,7 @@ export const getShareUrl = async (parent?: egret.DisplayObjectContainer) => { ...@@ -34,6 +34,7 @@ export const getShareUrl = async (parent?: egret.DisplayObjectContainer) => {
if (parent) parent.addChild(showoff); if (parent) parent.addChild(showoff);
showoff.visible = false; showoff.visible = false;
img.style.display = 'block'; img.style.display = 'block';
// console.log("test==getSharePic");
const base64 = getPrintScreenData(showoff, 0, 0, pic.textureWidth, parent.stage.stageHeight); const base64 = getPrintScreenData(showoff, 0, 0, pic.textureWidth, parent.stage.stageHeight);
// NetManager.ins.imgUrl((success) => { // NetManager.ins.imgUrl((success) => {
// const data = DataManager.ins.getData('imgURL'); // const data = DataManager.ins.getData('imgURL');
......
...@@ -26,7 +26,7 @@ export default async (stage, parent?: egret.DisplayObjectContainer, ) => { ...@@ -26,7 +26,7 @@ export default async (stage, parent?: egret.DisplayObjectContainer, ) => {
showoff.start(); showoff.start();
if (parent) parent.addChild(showoff); if (parent) parent.addChild(showoff);
showoff.visible=false; showoff.visible=false;
// console.log("test==getShowOff");
const base64 = getPrintScreenData(showoff['pic'], 0, 0, pic.textureWidth, stage.stageHeight); const base64 = getPrintScreenData(showoff['pic'], 0, 0, pic.textureWidth, stage.stageHeight);
img.style.display='block'; img.style.display='block';
// NetManager.ins.imgUrl((success) => { // NetManager.ins.imgUrl((success) => {
......
...@@ -21,6 +21,7 @@ class Share2 extends ComponentBase { ...@@ -21,6 +21,7 @@ class Share2 extends ComponentBase {
start() { start() {
this.once(egret.TouchEvent.ADDED_TO_STAGE, () => { this.once(egret.TouchEvent.ADDED_TO_STAGE, () => {
// console.log("test==shareCtrl");
this.height = this.stage.stageHeight; this.height = this.stage.stageHeight;
}, this); }, this);
......
...@@ -20,6 +20,7 @@ class Share3 extends ComponentBase { ...@@ -20,6 +20,7 @@ class Share3 extends ComponentBase {
this['avatar'].source = user.avatar; this['avatar'].source = user.avatar;
this['nameTxt'].text = getNick(user.nickname); this['nameTxt'].text = getNick(user.nickname);
this.once(egret.TouchEvent.ADDED_TO_STAGE, () => { this.once(egret.TouchEvent.ADDED_TO_STAGE, () => {
// console.log("test==getFriendShare3");
this.height = this.stage.stageHeight; this.height = this.stage.stageHeight;
}, this); }, this);
......
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