Does anyone know what OnLoading() is meant to do?
Monkey Forums/Monkey Programming/Does anyone know what OnLoading() is meant to do?
| ||
A working example would be nice. I cannot get a peep out of it. How is it meant to be used? |
| ||
That's what version.txt says: OnLoading now called instead of OnUpdate/OnRender if app is still Loading stuff. So OnUpdate and OnRender are not called as long as the loading isn't finished yet... |
| ||
But.... how often is it called? Once? 30 times a second? How does it know stuff is loading? Can this be used for a progress bar etc? |
| ||
Indeed good questions! Actually I don't knowp but would be very interested in the answers, too. |
| ||
I based MojoMax off on the Flash version of Mojo, which calls OnLoading in the InvokeRender, which is called in the main loop, so it gets called the same number of times as OnRender ;) Basically there is a variable called "loading", this is increased in LoadImage (LoadSurface in native), once it has finished loading a image it decreases, the call to OnLoading only happens if the "loading" variable is "true". |
| ||
It's target specific. For some, like iOS it is not used/needed as Apple already provides a standard mechanism for displaying a splash screen while your app loads. Mojo on Flash now uses embedded graphics so the OnLoading mechanism is also redundant. |
| ||
It's target specific. Yep this is correct, OnLoading is not called for the following targets: * iOS * Android * GLFW * XNA Mojo on Flash now uses embedded graphics so the OnLoading mechanism is also redundant. But the code is there in Flash??? |
| ||
>>For some, like iOS it is not used/needed as Apple already provides a standard mechanism for displaying a splash screen while your app loads really? How's that then? |
| ||
It just is. [edit] Google ios splash or some such if you want more information. If you are going to publish for iOS you really should be familiar with the getting started docs Apple provides, they really are quite well written. |
| ||
Or if you want you can just do a loading screen yourself without messing with the XCode stuff... http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/BuildTimeConfiguration/BuildTimeConfiguration.html#//apple_ref/doc/uid/TP40007072-CH7-SW12 |
| ||
I just put me logo up, and let it get on with it! I'd probably change it if there was enough media, but, Logic Battleships and Nags take about 3 seconds, which is an adequate amount of time to display a logo IMO. Dabz |
| ||
I added a splash screen and do the loading whilst it is displayed, I then "cache" the images to the GPU (really need this with Android) at the same time... |