EditorResourceTooltipPlugin
A plugin that advanced tooltip for its handled resource type.
EditorResourceTooltipPlugin.swift:14class EditorResourceTooltipPlugin
Resource tooltip plugins are used by FileSystemDock
to generate customized tooltips for specific resources. E.g. tooltip for a Texture2D
displays a bigger preview and the texture’s dimensions.
A plugin must be first registered with addResourceTooltipPlugin(_:)
. When the user hovers a resource in filesystem dock which is handled by the plugin, _makeTooltipForPath(_:metadata:base:)
is called to create the tooltip. It works similarly to _makeCustomTooltip(forText:)
.
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 requestThumbnail(path: String, control: TextureRect?
) Requests a thumbnail for the given
TextureRect
. The thumbnail is created asynchronously byEditorResourcePreview
and automatically set when available.
Show implementation details (2)
Hide implementation details
func _handles(type: String
) -> Bool Return
true
if the plugin is going to handle the givenResource
type
.func _makeTooltipForPath(String, metadata: GDictionary, base: Control?
) -> Control? Create and return a tooltip that will be displayed when the user hovers a resource under the given
path
in filesystem dock.