:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/PCKPacker.xml. .. _class_PCKPacker: PCKPacker ========= **Inherits:** :ref:`Reference` **<** :ref:`Object` Creates packages that can be loaded into a running project. .. rst-class:: classref-introduction-group Description ----------- The **PCKPacker** is used to create packages that can be loaded into a running project using :ref:`ProjectSettings.load_resource_pack`. :: var packer = PCKPacker.new() packer.pck_start("test.pck") packer.add_file("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. .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`add_file` **(** :ref:`String` pck_path, :ref:`String` source_path **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`flush` **(** :ref:`bool` verbose=false **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`pck_start` **(** :ref:`String` pck_name, :ref:`int` alignment=0 **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_PCKPacker_method_add_file: .. rst-class:: classref-method :ref:`Error` **add_file** **(** :ref:`String` pck_path, :ref:`String` source_path **)** Adds the ``source_path`` file to the current PCK package at the ``pck_path`` internal path (should start with ``res://``). .. rst-class:: classref-item-separator ---- .. _class_PCKPacker_method_flush: .. rst-class:: classref-method :ref:`Error` **flush** **(** :ref:`bool` verbose=false **)** Writes the files specified using all :ref:`add_file` calls since the last flush. If ``verbose`` is ``true``, a list of files added will be printed to the console for easier debugging. .. rst-class:: classref-item-separator ---- .. _class_PCKPacker_method_pck_start: .. rst-class:: classref-method :ref:`Error` **pck_start** **(** :ref:`String` pck_name, :ref:`int` alignment=0 **)** Creates a new PCK file with the name ``pck_name``. The ``.pck`` file extension isn't added automatically, so it should be part of ``pck_name`` (even though it's not required). .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`