Signal1
Signal support.
EditorResourcePreview.swift:193class Signal1
Use the connect(flags:_:)
method to connect to the signal on the container object, and disconnect(_:)
to drop the connection.
You can also await the emitted
property for waiting for a single emission of the signal.
Other members in extension
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.
Citizens in SwiftGodot
Instance members
var emitted: Void
You can await this property to wait for the signal to be emitted once
func connect(flags: Object.ConnectFlags, @escaping (_ path: String) -> ()
) -> Object Connects the signal to the specified callback
func disconnect(Object
) Disconnects a signal that was previously connected, the return value from calling
connect(flags:_:)