Jump to content

babylon.2.5.canvas2d.js problem


babaorhum
 Share

Recommended Posts

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

 

screenshot.jpg

screenshot2.jpg

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.  

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...