babaorhum Posted March 21, 2017 Share Posted March 21, 2017 Hello everyone and thank you all for babylonjs according to this console : there is a bug both library are the same version 2.5 Can it explain blank canvas from visual studio? The NuggetManager only provide 2.3... babylonjs but canvas2D at all Kind regards, But I may be wrong of course Quote Link to comment Share on other sites More sharing options...
adam Posted March 21, 2017 Share Posted March 21, 2017 You need to load BJS first. Quote Link to comment Share on other sites More sharing options...
babaorhum Posted March 22, 2017 Author Share Posted March 22, 2017 It seems to me that it is actually the case isn't it? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 22, 2017 Share Posted March 22, 2017 Nopte..the canvas file is loaded before babylonjs Quote Link to comment Share on other sites More sharing options...
jerome Posted March 23, 2017 Share Posted March 23, 2017 Actually the declaration order of the <script> tags doesn't really matter, because the download time of each file is unpredictable. Each JS file is downloaded by the browser at its own variable speed (depending so many things : the web server charge, the network charge, the hypothetical different paths to different hosts, each file size, etc) and is run just after it's received. So whatever the declaration order the first declared JS file may be run after the last declared one. And vice-versa. Imho, the right thing to do would be to bind each dependency execution to some core events... Example : window.onload (here, we're sure that everything is completely downloaded) = run your code what calls some BJS functions (we are also sure that BJS is downloaded and run) If a dependant lib needs that BJS is already accessible (loaded or run) because it calls alone some BJS functions by its own (something different than : the user call a lib function what calls a core function), it should rely on the same process. Quote Link to comment Share on other sites More sharing options...
babaorhum Posted March 23, 2017 Author Share Posted March 23, 2017 16 hours ago, Deltakosh said: Nopte..the canvas file is loaded before babylonjs Thx guys, no more such error 1 hour ago, jerome said: mple : window.onload (here, we're sure that everything is completely downloaded) = run your code what calls some BJS functions (we are also sure that BJS is downloaded and run) If a dependant lib needs that BJS is already accessible (loaded or run) because it calls alone some BJS functions by its own (something different than : the user call a lib function what calls a core function), it should rely on the same process. I had already such function going now it is the canvas2D that doesn't load anything and send errors Quote Uncaught TypeError: Cannot read property 'push' of undefined at n._registerTrackedNode (babylon.2.5.canvas2d.js:8) at n [as constructor] (babylon.2.5.canvas2d.js:5) at n [as constructor] (babylon.2.5.canvas2d.js:7) at new n (babylon.2.5.canvas2d.js:8) at panel (sceneBase.js:73) at createScene (sceneBase.js:117) at sceneBase.js:134 works on playground, and if I comment the canvas2D snippet it works... any idea? http://babylonjs-playground.com/#1MVIGI#8 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 23, 2017 Share Posted March 23, 2017 PG is using 3.0-alpha You should do the same. Don't be afraid by the version number. The release is already rock solid Quote Link to comment Share on other sites More sharing options...
adam Posted March 23, 2017 Share Posted March 23, 2017 10 hours ago, jerome said: Actually the declaration order of the <script> tags doesn't really matter, because the download time of each file is unpredictable. Each JS file is downloaded by the browser at its own variable speed (depending so many things : the web server charge, the network charge, the hypothetical different paths to different hosts, each file size, etc) and is run just after it's received. If you try loading this page: <!doctype html> <html> <head> <script src="babylon.canvas2d.js"></script> <script src="babylon.max.js"></script> </head> <body> </body> </html> and then open the console you will see this error: Uncaught TypeError: Cannot read property 'Effect' of undefined at babylon.canvas2d.js:1 edit: Scripts execute in the order they appear on the page unless the html5 async property is used. Quote Link to comment Share on other sites More sharing options...
jerome Posted March 23, 2017 Share Posted March 23, 2017 Well, Adam is right... I kept a distant bad experience in mind where the declaration order wasn't respected. But it is. And it shall be : http://docstore.mik.ua/orelly/webprog/jscript/ch12_03.htm Whatever the actual download order or delay. Please don't take notice of my former post. Quote Link to comment Share on other sites More sharing options...
babaorhum Posted March 24, 2017 Author Share Posted March 24, 2017 15 hours ago, Deltakosh said: PG is using 3.0-alpha You should do the same. Don't be afraid by the version number. The release is already rock solid I was waiting for the official release with red carpet and champagne, but I give it a shot GameMonetize 1 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.