EditorResourcePreviewGenerator
Custom generator of previews.
EditorResourcePreviewGenerator.swift:11class EditorResourcePreviewGenerator
Custom code to generate previews. Please check file_dialog/thumbnail_size
in EditorSettings
to find out the right size to do previews at.
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
Show implementation details (5)
Hide implementation details
func _canGenerateSmallPreview(
) -> Bool If this function returns
true
, the generator will call_generate(resource:size:metadata:)
or_generateFromPath(_:size:metadata:)
for small previews as well.func _generate(resource: Resource?, size: Vector2i, metadata: GDictionary
) -> Texture2D? Generate a preview from a given resource with the specified size. This must always be implemented.
func _generateFromPath(String, size: Vector2i, metadata: GDictionary
) -> Texture2D? Generate a preview directly from a path with the specified size. Implementing this is optional, as default code will load and call
_generate(resource:size:metadata:)
.func _generateSmallPreviewAutomatically(
) -> Bool If this function returns
true
, the generator will automatically generate the small previews from the normal preview texture generated by the methods_generate(resource:size:metadata:)
or_generateFromPath(_:size:metadata:)
.func _handles(type: String
) -> Bool Returns
true
if your generator supports the resource of typetype
.