BoxArtManager
Inherits: Resource
Fetch and manage artwork from registered BoxArtProvider nodes
Description
The BoxArtManager is responsible for managing any number of BoxArtProvider nodes and providing a unified way to fetch box art from multiple sources to any systems that might need them. New box art sources can be created in the core code base or in plugins by implementing/extending the BoxArtProvider class and adding them to the scene.
With registered box art providers, other systems can request box art from the BoxArtManager, and it will use all available sources to return the best artwork:
const BoxArtManager := preload("res://core/global/boxart_manager.tres")
...
var boxart := BoxArtManager.get_boxart(library_item, BoxArtProvider.LAYOUT.LOGO)
Properties
| Type | Name | Default |
|---|---|---|
| CustomLogger | logger |
Methods
| Returns | Signature |
|---|---|
| Texture2D | get_boxart(item: LibraryItem, kind: int) |
| Texture2D | get_boxart_or_placeholder(item: LibraryItem, kind: int) |
| Texture2D | get_placeholder(kind: int) |
| BoxArtProvider | get_provider_by_id(id: String) |
| Array | get_providers() |
| Array | get_provider_ids() |
| void | register_provider(provider: BoxArtProvider) |
| void | unregister_provider(provider: BoxArtProvider) |
Property Descriptions
logger
CustomLogger logger
Note
There is currently no description for this property. Please help us by contributing one!
Method Descriptions
get_boxart()
Texture2D get_boxart(item: LibraryItem, kind: int)
Returns the boxart of the given kind for the given library item.
get_boxart_or_placeholder()
Texture2D get_boxart_or_placeholder(item: LibraryItem, kind: int)
Returns the boxart of the given kind for the given library item. If one is not found, a placeholder texture will be returned
get_placeholder()
Texture2D get_placeholder(kind: int)
Returns a boxart placeholder for the given layout
get_provider_by_id()
BoxArtProvider get_provider_by_id(id: String)
Returns the given boxart implementation by id
get_providers()
Array get_providers()
Returns a list of all registered boxart providers
get_provider_ids()
Array get_provider_ids()
Returns a list of all registered boxart provider ids
register_provider()
void register_provider(provider: BoxArtProvider)
Registers the given boxart provider with the boxart manager.
unregister_provider()
void unregister_provider(provider: BoxArtProvider)
Unregisters the given boxart provider