Dynamic Reload (Smash Hit)¶
- knReload()¶
If on the main menu, this reloads the main menu on the next frame. The main menu script will continue to run as normal until then.
If in a level, this is nearly equivalent to
mgCommand("level.restart").
-
knReloadTemplates():
boolean¶ Reloads
templates.xml. Returnstrueon success.Changed in version 22: Renamed from
knLoadTemplates
- knReloadGfx()¶
Reloads most static textures and shaders by calling
Gfx::load1()andGfx::load2(). It should be noted that this will cause a short freeze on most devices as textures and shaders are reloaded (which may be very long on older or weaker devices).Gfx::load1()loads the following:All shaders
effects/default.pnggfx/tiles.pnggfx/ball.pnggfx/bestdistance.pnggfx/menu_distance.pnggfx/best_menu_distance.png
Gfx::load2()loads the following:gfx/sprites.pnggfx/doors.pnggfx/metalnormal.jpggfx/glassnormal.jpggfx/credits.pnggfx/menu_linestart.pnggfx/menu_lineend.pnggfx/menu_lineglow.png
Note
The game splits loading into steps, and between each step the game will draw exactly 10 frames of the loading screen (enough to display a “loading dot”).
This has two purposes: one is to let the user know the game is loading, and the other is to let Android know that the game has not stopped responding (since otherwise Android would notice the game hasn’t drawn to the screen for a while and tell the user the app has stopped responding).
Loading the graphics gets two steps “as a treat” because it often takes the most time to load. (For what it’s worth, the Audio subsystem also has two loading steps, though they take much less time.)
Changed in version 22: Renamed from
knLoadGfx
- knReloadPlayer()¶
Reloads
progress.xmlfrom the save directory. This is very useful for resetting player stats.Added in version 22.
- knQuickSave()¶
Do a quick save.
Added in version 22.
-
knQuickLoad():
boolean¶ Do a quick load. Returns a boolean indicating success.
Added in version 22.
- knQuickClear()¶
Clear player’s quick save.
Added in version 22.