0.2.0-dev Download ZIP
42 lines ·2.0 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="ImageFormatLoaderExtension" inherits="ImageFormatLoader" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | Base class for creating [ImageFormatLoader] extensions (adding support for extra image formats). |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | 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. |
| 8 | 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. |
| 9 | </description> |
| 10 | <tutorials> |
| 11 | </tutorials> |
| 12 | <methods> |
| 13 | <method name="_get_recognized_extensions" qualifiers="virtual const"> |
| 14 | <return type="PackedStringArray" /> |
| 15 | <description> |
| 16 | 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. |
| 17 | </description> |
| 18 | </method> |
| 19 | <method name="_load_image" qualifiers="virtual"> |
| 20 | <return type="int" enum="Error" /> |
| 21 | <param index="0" name="image" type="Image" /> |
| 22 | <param index="1" name="fileaccess" type="FileAccess" /> |
| 23 | <param index="2" name="flags" type="int" enum="ImageFormatLoader.LoaderFlags" is_bitfield="true" /> |
| 24 | <param index="3" name="scale" type="float" /> |
| 25 | <description> |
| 26 | Loads the content of [param fileaccess] into the provided [param image]. |
| 27 | </description> |
| 28 | </method> |
| 29 | <method name="add_format_loader"> |
| 30 | <return type="void" /> |
| 31 | <description> |
| 32 | Add this format loader to the engine, allowing it to recognize the file extensions returned by [method _get_recognized_extensions]. |
| 33 | </description> |
| 34 | </method> |
| 35 | <method name="remove_format_loader"> |
| 36 | <return type="void" /> |
| 37 | <description> |
| 38 | Remove this format loader from the engine. |
| 39 | </description> |
| 40 | </method> |
| 41 | </methods> |
| 42 | </class> |