Forum

"loaded_cb" ?

16 July 2015 21:16
I may not be a newbie anymore, but I am learning B4W ***AND*** Javascript by pulling apart sample codes, reading the API reference and Javascript sites to learn what is happening, and then making changes to see what they do.

By doing it this way, I sometimes find answers that aren't totally clear to me, and I suspect those questions belong in the "newbie" section. In this case, I have an opportunity to find out what a callback function does, and why it is needed.

So… what does "loaded_cb" do?

17 July 2015 10:03
Hello.

So… what does "loaded_cb" do?

The engine calls the "loaded_cb" function after the scenes loaded. Another worlds, all scene's objects are available and you can operate with them.
17 July 2015 22:27
So this function is done as a callback precisely so that it won't be applied until the scene is loaded? Or is it like a flag indicating that the scene is loaded?
18 July 2015 03:00
Your first suggestion is correct.
The Founder | Twitter | Facebook | Linkedin
18 July 2015 10:54
It's funny. The number my brain gets the more I seem to understand! Thanks!
 
Please register or log in to leave a reply.