PCKPacker
Creates packages that can be loaded into a running project.
PCKPacker.swift:20class PCKPacker
The PCKPacker
is used to create packages that can be loaded into a running project using loadResourcePack(_:replaceFiles:offset:)
.
The above PCKPacker
creates package test.pck
, then adds a file named text.txt
at the root of the package.
Superclasses
class RefCounted
Base class for reference-counted objects.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
func addFile(pckPath: String, sourcePath: String, encrypt: Bool
) -> GodotError Adds the
sourcePath
file to the current PCK package at thepckPath
internal path (should start withres://
).func flush(verbose: Bool
) -> GodotError Writes the files specified using all
addFile(pckPath:sourcePath:encrypt:)
calls since the last flush. Ifverbose
istrue
, a list of files added will be printed to the console for easier debugging.func pckStart(pckName: String, alignment: Int32, key: String, encryptDirectory: Bool
) -> GodotError Creates a new PCK file with the name
pckName
. The.pck
file extension isn’t added automatically, so it should be part ofpckName
(even though it’s not required).