Table of Contents

Class ImageFormatLoaderExtension

Namespace
Godot
Assembly
GodotSharp.dll

The engine supports multiple image formats out of the box (PNG, SVG, JPEG, WebP to name a few), but you can choose to implement support for additional image formats by extending this class.

Be sure to respect the documented return types and values. You should create an instance of it, and call AddFormatLoader() to register that loader during the initialization phase.

public class ImageFormatLoaderExtension : ImageFormatLoader, IDisposable
Inheritance
ImageFormatLoaderExtension
Implements
Inherited Members

Constructors

ImageFormatLoaderExtension()

public ImageFormatLoaderExtension()

Methods

AddFormatLoader()

Add this format loader to the engine, allowing it to recognize the file extensions returned by _GetRecognizedExtensions().

public void AddFormatLoader()

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

RemoveFormatLoader()

Remove this format loader from the engine.

public void RemoveFormatLoader()

_GetRecognizedExtensions()

Returns the list of file extensions for this image format. Files with the given extensions will be treated as image file and loaded using this class.

public virtual string[] _GetRecognizedExtensions()

Returns

string[]

_LoadImage(Image, FileAccess, LoaderFlags, float)

Loads the content of fileaccess into the provided image.

public virtual Error _LoadImage(Image image, FileAccess fileaccess, ImageFormatLoader.LoaderFlags flags, float scale)

Parameters

image Image
fileaccess FileAccess
flags ImageFormatLoader.LoaderFlags
scale float

Returns

Error