Core - Textures Module
anvil.lib.textures
ItemTexturesObject
Bases: AddonObject
Handles item textures for the addon.
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
Name | Type | Description |
---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The name of the addon object. |
queue
property
Queues the item textures.
Returns:
Name | Type | Description |
---|---|---|
object |
The parent's queue method result. |
__init__()
Initializes a ItemTexturesObject instance.
add_item(item_name, directory, *item_sprites)
Adds item textures to the content.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name
|
str
|
The name of the item. |
required |
directory
|
str
|
The directory path for the textures. |
required |
item_sprites
|
str
|
The names of the item sprites. |
()
|
content(content)
Sets the content of the addon object and returns the object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
content
|
any
|
The content to be set for the addon object. |
required |
Returns:
Name | Type | Description |
---|---|---|
self |
AddonObject
|
The instance of the current AddonObject. |
do_not_shorten()
Setter property that disables shortening of dict
when exporting.
TerrainTexturesObject
Bases: AddonObject
Handles terrain textures for the addon.
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
Name | Type | Description |
---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The name of the addon object. |
queue
property
Queues the block textures.
Returns:
Name | Type | Description |
---|---|---|
object |
The parent's queue method result. |
__init__()
Initializes a TerrainTexturesObject instance.
add_block(block_name, directory, *block_textures)
Adds block textures to the content.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name
|
str
|
The name of the block. |
required |
directory
|
str
|
The directory path for the textures. |
required |
block_textures
|
str
|
The names of the block textures. |
()
|
content(content)
Sets the content of the addon object and returns the object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
content
|
any
|
The content to be set for the addon object. |
required |
Returns:
Name | Type | Description |
---|---|---|
self |
AddonObject
|
The instance of the current AddonObject. |
do_not_shorten()
Setter property that disables shortening of dict
when exporting.
UITexturesObject
Bases: AddonObject
Handles UI textures for the addon.
identifier
property
Returns the identifier of the addon object in the format 'namespace:name'.
Returns:
Name | Type | Description |
---|---|---|
str |
Identifier
|
The identifier of the addon object. |
name
property
Returns the name of the addon object.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The name of the addon object. |
queue
property
Queues the item textures.
Returns:
Name | Type | Description |
---|---|---|
object |
The parent's queue method result. |
__init__()
Initializes a UITexturesObject instance.
add_item(texture_name, directory, *textures)
Adds item textures to the content.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
texture_name
|
str
|
The name of the texture. |
required |
directory
|
str
|
The directory path for the textures. |
required |
textures
|
str
|
The names of the textures. |
()
|
content(content)
Sets the content of the addon object and returns the object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
content
|
any
|
The content to be set for the addon object. |
required |
Returns:
Name | Type | Description |
---|---|---|
self |
AddonObject
|
The instance of the current AddonObject. |
do_not_shorten()
Setter property that disables shortening of dict
when exporting.