EditorResourcePreview
A node used to generate previews of resources or files.
EditorResourcePreview.swift:19class EditorResourcePreview
This node is used to generate previews for resources or files.
This object emits the following signals:
Superclasses
class Node
Base class for all scene 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.
Types
class Signal1
Signal support.
Type members
Instance members
var previewInvalidated: Signal1
Emitted if a preview was invalidated (changed).
path
corresponds to the path of the preview.func addPreviewGenerator(EditorResourcePreviewGenerator?
) Create an own, custom preview generator.
func checkForInvalidation(path: String
) Check if the resource changed, if so, it will be invalidated and the corresponding signal emitted.
func queueEditedResourcePreview(resource: Resource?, receiver: Object?, receiverFunc: StringName, userdata: Variant
) Queue the
resource
being edited for preview. Once the preview is ready, thereceiver
’sreceiverFunc
will be called. ThereceiverFunc
must take the following four arguments:String
path,Texture2D
preview,Texture2D
thumbnail_preview,Variant
userdata.userdata
can be anything, and will be returned whenreceiverFunc
is called.func queueResourcePreview(path: String, receiver: Object?, receiverFunc: StringName, userdata: Variant
) Queue a resource file located at
path
for preview. Once the preview is ready, thereceiver
’sreceiverFunc
will be called. ThereceiverFunc
must take the following four arguments:String
path,Texture2D
preview,Texture2D
thumbnail_preview,Variant
userdata.userdata
can be anything, and will be returned whenreceiverFunc
is called.func removePreviewGenerator(EditorResourcePreviewGenerator?
) Removes a custom preview generator.