ImageFormatLoaderExtension
继承: ImageFormatLoader
< RefCounted
< Object
Base class for creating ImageFormatLoader
extensions (adding support for extra image formats).
描述
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 add_format_loader
to register that loader during the initialization phase.
方法
PackedStringArray | _get_recognized_extensions ( ) virtual1 const2 |
Error | _load_image ( image: Image , fileaccess: FileAccess , flags: LoaderFlags, scale: float ) virtual1 |
void | add_format_loader ( ) |
void | remove_format_loader ( ) |
方法说明
PackedStringArray
_get_recognized_extensions ( ) virtual1 const2
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.
Error _load_image ( image: Image
, fileaccess: FileAccess
, flags: LoaderFlags, scale: float
) virtual1
Loads the content of fileaccess
into the provided image
.
void
add_format_loader ( )
Add this format loader to the engine, allowing it to recognize the file extensions returned by _get_recognized_extensions
.
void
remove_format_loader ( )
Remove this format loader from the engine.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。