Jump to content

container of debugLayer


Dad72
 Share

Recommended Posts

Hello,

 

Is it possible to choose the container in which the display debugLayer?  I'll explain in French for simplicity and clarity.

 

J'ai un système de Layout que j'ajoute à mon element <body>. ensuite tout mes autres élements comme le <canvas> est ajouter a mon système de Layout. Le probleme est que quand je veux afficher le debugLayer de Babylon, il est ajouter au <body> et pas sur mon layout, ce qui a pour resultat que je ne voie pas le DebugLayer qui est en dessous le layout.

 

Ce que je demanderais, c’est si il serait possible de pouvoir créer une option dans le debugLayer pour que l'on puisse l'ajouter nous même sur un element div a nous.

 

Par exemple en ajoutant une option "selector" dans la signature: 

scene.debugLayer.show(true, {selector: "#myDivIDPerso"});

De cette façons, j'ajoute un div vide a mon container Layout et quand je créer le debugLayer, je l'ajoute a ce div grâce a cette nouvelle option.

 

Qu'en pense tu DK, tu crois que cela pourrait être possible. Cela m'aiderais beaucoup, car je n'ai pas été capable d'afficher le DebugLayer sur mon Layout que je crée comme ca:

                $('.layout-desing').w2layout({			name: 'layout-desing',			panels: [				{ type: 'left', size: 250, resizable: true},				{ type: 'main'},				{ type: 'right', size: 380, resizable: true}			]		});		this.layoutW2uiDesing = w2ui['layout-desing'];		this.layoutW2uiDesing.content('left', '<div class="explorer"></div>');		this.layoutW2uiDesing.content('main', '<canvas id="renderEditor"></canvas><div class="DebugLayer"></div>');		this.layoutW2uiDesing.content('right', '<div id="propGrid"></div>');

En te remerciant d'avance.

Link to comment
Share on other sites

It's work, but I have a problem position.  This shift is the width of the margin that I have left in my layout and height of the top position of the Layout.

 

post-5292-0-67020300-1445112814.jpg

 

I add this, that works, but maybe there is a change to make in the DebugLayer to avoid doing this?.

$("#DebugLayer").css({"left":"0px", "top":"0px"});// Force left and top: 0px on element DebugLayer

Thanks.

Link to comment
Share on other sites

Arf, I meet a new problem now. The debugLayer create a canvas that takes clearColor color and thus prevents me from seeing my szene behind.
 
I fix like this:
$("#DebugLayerDrawingCanvas").css({"background-color":"rgb(0,0,0,0)"});

I do not know why but the canvas created by debugLayer takes color clearColor. maybe he should put transparent by default.

 

So:

$("#DebugLayer").css({"left":"0px", "top":"0px"}); // Fix 1 for position$("#DebugLayerDrawingCanvas").css({"background-color":"rgb(0,0,0,0)"}); // fix 2 for display scene
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...