leanderr Posted April 10, 2017 Share Posted April 10, 2017 Hey there, I finally got BabylonJS to work within Angular2 but I cannot manage the DebugLayer to work with the solution offered here. this._scene.debugLayer.show(); will always result in babylon.inspector.bundle.js:408 Uncaught ReferenceError: BABYLON is not defined at INSPECTOR (babylon.inspector.bundle.js:408) at Object.<anonymous> (babylon.inspector.bundle.js:408) at __webpack_require__ (babylon.inspector.bundle.js:21) at Object.<anonymous> (babylon.inspector.bundle.js:49) at __webpack_require__ (babylon.inspector.bundle.js:21) at babylon.inspector.bundle.js:41 at babylon.inspector.bundle.js:44 core.es5.js:1084 ERROR TypeError: Cannot read property 'Inspector' of undefined at t._createInspector (babylon.js:36) at HTMLScriptElement.n.onload (babylon.js:3) at HTMLScriptElement.wrapFn [as __zone_symbol___onload] (zone.js:1199) at ZoneDelegate.invokeTask (zone.js:398) at Object.onInvokeTask (core.es5.js:4116) at ZoneDelegate.invokeTask (zone.js:397) at Zone.runTask (zone.js:165) at HTMLScriptElement.ZoneTask.invoke (zone.js:460) Any Angular2 nerds around? Side-Question: The fancy DebugLayer we got in the Playground is only available in the newest Version but not in 2.5, is it? Best Regards Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 10, 2017 Share Posted April 10, 2017 Ping @Temechon who may know about this Quote Link to comment Share on other sites More sharing options...
Temechon Posted April 11, 2017 Share Posted April 11, 2017 Hi, Indeed the debug layer in only available in preview version. Are you using this version or 2.5 ? Quote Link to comment Share on other sites More sharing options...
royibernthal Posted April 11, 2017 Share Posted April 11, 2017 Hey leanderr Out of curiosity, what would be the advantages of combining BabylonJS with Angular2? Quote Link to comment Share on other sites More sharing options...
leanderr Posted April 20, 2017 Author Share Posted April 20, 2017 On 11.4.2017 at 3:36 PM, royibernthal said: Hey leanderr Out of curiosity, what would be the advantages of combining BabylonJS with Angular2? Well, I want to have quite a lot of user Interface Pages that load once the User enters the page. I don't want any content to be downloaded after Page init except for a little bit of REST. Quote Link to comment Share on other sites More sharing options...
royibernthal Posted April 21, 2017 Share Posted April 21, 2017 Are those interfaces in any way related to bjs engine or are they standard HTML generated by Angular 2? Quote Link to comment Share on other sites More sharing options...
leanderr Posted April 21, 2017 Author Share Posted April 21, 2017 Thanks for trying to help. They are generated by NG2, its like 10 forms the user can customize their game experience on. Quote Link to comment Share on other sites More sharing options...
jeremybyington Posted April 22, 2017 Share Posted April 22, 2017 If BABYLON is undefined it likely means you are requesting it out of sync. If you are diving into Angular then I am sure you are aware that you have to delay execution of your code until it has loaded. Furthermore, with the debug layer, you have to create it after all of your cameras/lights/meshes/etc have been loaded so it can reference them. Quote Link to comment Share on other sites More sharing options...
Temechon Posted April 22, 2017 Share Posted April 22, 2017 6 hours ago, jeremybyington said: Furthermore, with the debug layer, you have to create it after all of your cameras/lights/meshes/etc have been loaded so it can reference them Not necessarily. You can create it bvefore and use the 'refresh' button in the inspector to refresh the current panel Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.