NfFile
Summary
Represents a file asset that has been registered with the engine.Signature
Constructors
constructor
Constructs a new instance of the classProperties
path
Modifiers: readonly Type:get path(): string;
Internal URL path used to fetch the file.
Methods
arrayBuffer
Fetch the file and return its content as an .blob
Fetch the file and return its content as a .bytes
Fetch the file and return its content as a .formData
Fetch the file and return its content as .json
Fetch the file, parse it as JSON, and return the result.text
Fetch the file and return its content as a UTF-8 string.Remarks
Instances are returned byAssetManagerLibrary.getAsset. Each method lazily fetches the file from the engine’s virtual file system and returns the content in the requested format. All read methods throw NfFetchException when the underlying fetch returns a non-OK response.