PCKPacker.xml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="PCKPacker" inherits="Reference" version="3.4">
  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. [codeblock]
  9. var packer = PCKPacker.new()
  10. packer.pck_start("test.pck")
  11. packer.add_file("res://text.txt", "text.txt")
  12. packer.flush()
  13. [/codeblock]
  14. The above [PCKPacker] creates package [code]test.pck[/code], then adds a file named [code]text.txt[/code] at the root of the package.
  15. </description>
  16. <tutorials>
  17. </tutorials>
  18. <methods>
  19. <method name="add_file">
  20. <return type="int" enum="Error">
  21. </return>
  22. <argument index="0" name="pck_path" type="String">
  23. </argument>
  24. <argument index="1" name="source_path" type="String">
  25. </argument>
  26. <description>
  27. 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]).
  28. </description>
  29. </method>
  30. <method name="flush">
  31. <return type="int" enum="Error">
  32. </return>
  33. <argument index="0" name="verbose" type="bool" default="false">
  34. </argument>
  35. <description>
  36. 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.
  37. </description>
  38. </method>
  39. <method name="pck_start">
  40. <return type="int" enum="Error">
  41. </return>
  42. <argument index="0" name="pck_name" type="String">
  43. </argument>
  44. <argument index="1" name="alignment" type="int" default="0">
  45. </argument>
  46. <description>
  47. 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).
  48. </description>
  49. </method>
  50. </methods>
  51. <constants>
  52. </constants>
  53. </class>