2022-07-08 21:01:02 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-06 16:08:05 +08:00
<class name= "ImageFormatLoaderExtension" inherits= "ImageFormatLoader" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2022-07-08 21:01:02 +08:00
<brief_description >
Base class for creating [ImageFormatLoader] extensions (adding support for extra image formats).
</brief_description>
<description >
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.
2022-09-30 20:23:36 +08:00
Be sure to respect the documented return types and values. You should create an instance of it, and call [method add_format_loader] to register that loader during the initialization phase.
2022-07-08 21:01:02 +08:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "_get_recognized_extensions" qualifiers= "virtual const" >
<return type= "PackedStringArray" />
<description >
2022-09-30 20:23:36 +08:00
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.
2022-07-08 21:01:02 +08:00
</description>
</method>
<method name= "_load_image" qualifiers= "virtual" >
<return type= "int" enum= "Error" />
<param index= "0" name= "image" type= "Image" />
<param index= "1" name= "fileaccess" type= "FileAccess" />
2023-06-15 22:06:22 +08:00
<param index= "2" name= "flags" type= "int" enum= "ImageFormatLoader.LoaderFlags" is_bitfield= "true" />
2022-07-08 21:01:02 +08:00
<param index= "3" name= "scale" type= "float" />
<description >
Loads the content of [param fileaccess] into the provided [param image].
</description>
</method>
<method name= "add_format_loader" >
<return type= "void" />
<description >
Add this format loader to the engine, allowing it to recognize the file extensions returned by [method _get_recognized_extensions].
</description>
</method>
<method name= "remove_format_loader" >
<return type= "void" />
<description >
Remove this format loader from the engine.
</description>
</method>
</methods>
</class>