Forums » HTML5 Framework » Is it possible to load resource whenever we need it, not just preload at the start? »
| Wasin Thonkaew | Is it possible to load resource whenever we need it, not just preload at the start? | ||
|---|---|---|---|
|
Added by Wasin Thonkaew 12 months ago
I saw the following code
I would like to know whether it's possible to load resource whenever we need it (such as when we switch into a new scene). So we don't have to load all the game's resource which may be huge at the first place. |
||
| Shun Lin | RE: Is it possible to load resource whenever we need it, not just preload at the start? | ||
|
Of course, you may preload them whenever you want. However, please make sure that the preloading has done before they are displayed. |
||
| Wasin Thonkaew | RE: Is it possible to load resource whenever we need it, not just preload at the start? | ||
|
Added by Wasin Thonkaew 12 months ago
Thanks Shun Lin! |
||
| Wasin Thonkaew | RE: Is it possible to load resource whenever we need it, not just preload at the start? | ||
|
Added by Wasin Thonkaew 12 months ago
Hey, you may have miss-understand my point. Is that possible? Or I should preload everything at the very first time, the same place at the original code has done in cocos2d.js. If this is the case, then HTML5 game should not be that big, all content should be packed up nicely within a limit that not hurt browser and system's ram that much? Any suggestion or thoughts are welcomed. Thanks! |
||
| Shun Lin | RE: Is it possible to load resource whenever we need it, not just preload at the start? | ||
|
It is possible to preload resources on each Scene. You may try it by yourself. Next step, we plan to write a demo which shows how to preload them, and add LoderScene class into engine. |
||
| Wasin Thonkaew | RE: Is it possible to load resource whenever we need it, not just preload at the start? | ||
|
Added by Wasin Thonkaew 12 months ago
I tested preloading for each scene, it works fine on Desktop PC. |
(1-5/5)