Precache Functions
Functions to precache files, preventing stutters.
precacheImage
precacheImage(file:String, ?allowGPU:Bool = true):Void
Precaches a file in "images/" folder.
- file - File name path, don't include the extension!
- allowGPU (Optional) - Force disable GPU Caching if you set to false.
Examples:
- precacheImage('myImage') - Precaches "mods/My-Mod/images/myImage.png".
- precacheImage('myImage', false) - The same as above, but it disables GPU Caching, this is necessary for specific shaders or it might display as a black box.
precacheSound
precacheSound(file:String):Void
Precaches a file in "sounds/" folder.
- file - File name path, don't include the extension!
Examples:
- precacheMusic('mySound') - Precaches "mods/My-Mod/sounds/mySound.ogg".
precacheMusic
precacheMusic(file:String):Void
Precaches a file in "music/" folder.
- file - File name path, don't include the extension!
Examples:
- precacheMusic('myMusic') - Precaches "mods/My-Mod/music/myMusic.ogg".
addCharacterToList
addCharacterToList(name:String, type:String):Void
Precaches a character, best used in conjunction with "triggerEvent" of
"Change Character" to allow you to change characters through a Lua Script for custom mechanics.
- name - Character .JSON name.
- type - Character type: "bf", "dad" or "gf".
Examples:
- addCharacterToList('pico-playable', 'bf') - Precaches "pico-playable" as a Player Character.
- addCharacterToList('tankman', 'dad') - Precaches "tankman" as an Opponent Character.
- addCharacterToList('gf-pixel', 'gf') - Precaches "gf-pixel" as a GF Character.