PCKPacker.xml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="PCKPacker" inherits="RefCounted" version="4.0">
  3. <brief_description>
  4. Creates packages that can be loaded into a running project.
  5. </brief_description>
  6. <description>
  7. The [PCKPacker] is used to create packages that can be loaded into a running project using [method ProjectSettings.load_resource_pack].
  8. [codeblocks]
  9. [gdscript]
  10. var packer = PCKPacker.new()
  11. packer.pck_start("test.pck")
  12. packer.add_file("res://text.txt", "text.txt")
  13. packer.flush()
  14. [/gdscript]
  15. [csharp]
  16. var packer = new PCKPacker();
  17. packer.PckStart("test.pck");
  18. packer.AddFile("res://text.txt", "text.txt");
  19. packer.Flush();
  20. [/csharp]
  21. [/codeblocks]
  22. The above [PCKPacker] creates package [code]test.pck[/code], then adds a file named [code]text.txt[/code] at the root of the package.
  23. </description>
  24. <tutorials>
  25. </tutorials>
  26. <methods>
  27. <method name="add_file">
  28. <return type="int" enum="Error" />
  29. <argument index="0" name="pck_path" type="String" />
  30. <argument index="1" name="source_path" type="String" />
  31. <argument index="2" name="encrypt" type="bool" default="false" />
  32. <description>
  33. Adds the [code]source_path[/code] file to the current PCK package at the [code]pck_path[/code] internal path (should start with [code]res://[/code]).
  34. </description>
  35. </method>
  36. <method name="flush">
  37. <return type="int" enum="Error" />
  38. <argument index="0" name="verbose" type="bool" default="false" />
  39. <description>
  40. Writes the files specified using all [method add_file] calls since the last flush. If [code]verbose[/code] is [code]true[/code], a list of files added will be printed to the console for easier debugging.
  41. </description>
  42. </method>
  43. <method name="pck_start">
  44. <return type="int" enum="Error" />
  45. <argument index="0" name="pck_name" type="String" />
  46. <argument index="1" name="alignment" type="int" default="0" />
  47. <argument index="2" name="key" type="String" default="&quot;&quot;" />
  48. <argument index="3" name="encrypt_directory" type="bool" default="false" />
  49. <description>
  50. Creates a new PCK file with the name [code]pck_name[/code]. The [code].pck[/code] file extension isn't added automatically, so it should be part of [code]pck_name[/code] (even though it's not required).
  51. </description>
  52. </method>
  53. </methods>
  54. </class>