PCKPacker
Hereda: RefCounted < Object
Crea paquetes que pueden ser cargados en un proyecto en curso.
Descripción
The PCKPacker is used to create packages that can be loaded into a running project using ProjectSettings.load_resource_pack().
var packer = PCKPacker.new()
packer.pck_start("test.pck")
packer.add_file("res://text.txt", "text.txt")
packer.flush()
var packer = new PckPacker();
packer.PckStart("test.pck");
packer.AddFile("res://text.txt", "text.txt");
packer.Flush();
The above PCKPacker creates package test.pck, then adds a file named text.txt at the root of the package.
Note: PCK is Godot's own pack file format. To create ZIP archives that can be read by any program, use ZIPPacker instead.
Métodos
add_file(target_path: String, source_path: String, encrypt: bool = false) |
|
add_file_removal(target_path: String) |
|
pck_start(pck_path: String, alignment: int = 32, key: String = "0000000000000000000000000000000000000000000000000000000000000000", encrypt_directory: bool = false) |
Descripciones de Métodos
Error add_file(target_path: String, source_path: String, encrypt: bool = false) 🔗
Adds the source_path file to the current PCK package at the target_path internal path. The res:// prefix for target_path is optional and stripped internally. File content is immediately written to the PCK.
Error add_file_removal(target_path: String) 🔗
Registra la eliminación de un archivo en la ruta interna target_path del PCK. Se utiliza principalmente para parches. Si el archivo en esta ruta se ha cargado desde un PCK anterior, se eliminará. El prefijo res:// para target_path es opcional y se elimina internamente.
Error flush(verbose: bool = false) 🔗
Escribe el directorio de archivos y cierra el PCK. Si verbose es true, se imprimirá una lista de los archivos añadidos en la consola para facilitar la depuración.
Nota: PCKPacker se vaciará automáticamente cuando se libere, lo que sucede cuando sale del alcance o cuando se le asigna null. En C#, la referencia debe eliminarse después de su uso, ya sea con la declaración using o llamando al método Dispose directamente.
Error pck_start(pck_path: String, alignment: int = 32, key: String = "0000000000000000000000000000000000000000000000000000000000000000", encrypt_directory: bool = false) 🔗
Crea un nuevo archivo PCK en la ruta de archivo pck_path. La extensión de archivo .pck no se añade automáticamente, por lo que debe formar parte de pck_path (aunque no es obligatorio).