PCKPacker.xml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="PCKPacker" inherits="Reference" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  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. <argument index="0" name="pck_path" type="String" />
  22. <argument index="1" name="source_path" type="String" />
  23. <description>
  24. 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]).
  25. </description>
  26. </method>
  27. <method name="flush">
  28. <return type="int" enum="Error" />
  29. <argument index="0" name="verbose" type="bool" default="false" />
  30. <description>
  31. 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.
  32. </description>
  33. </method>
  34. <method name="pck_start">
  35. <return type="int" enum="Error" />
  36. <argument index="0" name="pck_name" type="String" />
  37. <argument index="1" name="alignment" type="int" default="0" />
  38. <description>
  39. 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).
  40. </description>
  41. </method>
  42. </methods>
  43. <constants>
  44. </constants>
  45. </class>