FangEngine.store.asset_store.image_asset_store
This module contains the image asset store
Class ImageAssetStore
By default, loads all assets saved in assets/images
Images are saved with dot notation in all lowercase without the file extension
For example, the image assets/images/player/player_top.png would be referenced by player.player_top
Supported image formats:
PNG, JPG, GIF, BMP
__delitem__(self, key)
__getitem__(self, item)
__iter__(self)
__len__(self)
__new__(cls, args, kwargs)
__repr__(self)
__setitem__(self, key, value)
count(self) -> int
Returns the number of assets in the store
delete(self, name: str)
Deletes and returns the asset with the specified name
get(self, name: str)
Returns the asset with the specified name
get_all(self, search: str = ) -> list
Returns everything in the asset store
Parameter search: the text the names must start with (or blank for everything)
Returns list of assets
get_all_names(self, search: str = ) -> typing.List[str]
Returns every name of every asset in the store
Parameter search: the text the names must start with (or blank for everything)
Returns list of names of assets
get_ignore_path(self, name: str)
get_random(self, search: str = )
Returns a random asset in the store
Parameter search: the text the names must start with (or blank for everything)
get_random_name(self, search: str = ) -> str
Returns a random asset name in the store
Parameter search: the text the names must start with (or blank for everything)
load_asset(self, path: str)
overload(self, path: str = None)
Reloads the assets
Note that this DOES NOT clear the current store. It simply overwrites whatever it finds
If a file is missing when the reload happens the original file will remain loaded
Parameter path: optional path to reload from
reload(self, path: str = None)
Reloads the assets
Note that this clears the current store and then loads everything
If a file is missing when the reload happens the file will NOT be loaded
Parameter path: optional path to reload from
set(self, name: str, asset: str)
Adds/overwrites the asset at the specified name
Parameter name:
Parameter asset: the asset