EditorResourcePreviewGenerator

Custom generator of previews.

Custom code to generate previews. Please check file_dialog/thumbnail_size in EditorSettings to find out the right size to do previews at.

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

canGenerateSmallPreview
bool canGenerateSmallPreview()

If this function returns true, the generator will call generate or generateFromPath for small previews as well. By default, it returns false.

generate
Ref!Texture generate(Resource from, Vector2 size)

Generate a preview from a given resource with the specified size. This must always be implemented. Returning an empty texture is an OK way to fail and let another generator take care. Care must be taken because this function is always called from a thread (not the main thread).

generateFromPath
Ref!Texture generateFromPath(String path, Vector2 size)

Generate a preview directly from a path with the specified size. Implementing this is optional, as default code will load and call generate. Returning an empty texture is an OK way to fail and let another generator take care. Care must be taken because this function is always called from a thread (not the main thread).

generateSmallPreviewAutomatically
bool generateSmallPreviewAutomatically()

If this function returns true, the generator will automatically generate the small previews from the normal preview texture generated by the methods generate or generateFromPath. By default, it returns false.

handles
bool handles(String type)

Returns true if your generator supports the resource of type type.

opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(EditorResourcePreviewGenerator other)
opEquals
bool opEquals(typeof(null) n)
toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Static functions

_new
EditorResourcePreviewGenerator _new()

Construct a new instance of EditorResourcePreviewGenerator. Note: use memnew!EditorResourcePreviewGenerator instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta