Appearance#
AppearanceManager is the parent-class of BackgroundManager and CostumeManager
These classes manage all appearances of an actor or world.
- class miniworlds.appearances.appearances_manager.AppearancesManager(parent)[Quellcode]#
Public Data Attributes:
Public Methods:
__init__(parent)add_new_appearance(source)Adds a new Appearance (costume or background) to manager.
set_new_appearance(source)add_new_appearances(sources)add_new_appearance_from_list(sources)Returns a new appearance (Background instance or Costume instance)
Switches to next appearance
length()Number of appearance in appearance manager
__len__()get_appearance_at_index(index)find_appearance(appearance)Searches for appearance; returns index of appearance
set_border(value)set_animated(value)set_animation_speed(value)set_upscaled(value)set_scaled_to_width(value)set_scaled_to_height(value)set_scaled(value)list()Returns all appearances in manager as list.
__str__()Return str(self).
remove_appearance([source])Removes an appearance (costume or background) from manager
reset()switch_appearance(source)animate(speed)animate_appearance(appearance, speed)Implemented in subclasses
__iter__()__next__()Private Methods:
_init_display()_create_appearance_from_source(source)_add_default_appearance()_add_first_appearance(appearance)_add_appearance_to_manager(appearance)_set_appearance_defaults()_set_all(attribute, value)Sets attribute for all appearance in manager.
_remove_appearance_from_manager(appearance)Removes appearance from manager If self.length == 1, the last costume is removed and a default appearance will be added.
- add_new_appearance(source)[Quellcode]#
Adds a new Appearance (costume or background) to manager.
called by
add_costumeandadd_backgroundin subclasses.- Rückgabetyp:
- add_new_appearance_from_list(sources)[Quellcode]#
- Rückgabetyp:
- add_new_appearances(sources)[Quellcode]#
- Rückgabetyp:
- animate(speed)[Quellcode]#
- animate_appearance(appearance, speed)[Quellcode]#
- property animation_speed#
- property border#
- abstract create_appearance()[Quellcode]#
Returns a new appearance (Background instance or Costume instance)
- Rückgabetyp:
- find_appearance(appearance)[Quellcode]#
Searches for appearance; returns index of appearance
- get_actual_appearance()[Quellcode]#
- Rückgabetyp:
- get_appearance_at_index(index)[Quellcode]#
- Rückgabetyp:
- property image: Surface#
- length()[Quellcode]#
Number of appearance in appearance manager
- list()[Quellcode]#
Returns all appearances in manager as list.
- Rückgabetyp:
- Rückgabe:
All appearances in manager as list
- Rückgabetyp:
List[appearance_mod.Appearance]
- next_appearance()[Quellcode]#
Switches to next appearance
- Rückgabetyp:
- Rückgabe:
the switched appearance
- Rückgabetyp:
appearance_mod.Appearance
- property orientation#
- remove_appearance(source=-1)[Quellcode]#
Removes an appearance (costume or background) from manager
- Defaults:
Removes last costume.
- Parameter:
source – The index of the new appearance or the Appearance which should be removed Defaults to -1
costume) ((last)
- reset()[Quellcode]#
- self_remove()[Quellcode]#
Implemented in subclasses
- Rückgabetyp:
- set_animated(value)[Quellcode]#
- set_animation_speed(value)[Quellcode]#
- set_border(value)[Quellcode]#
- set_new_appearance(source)[Quellcode]#
- set_scaled(value)[Quellcode]#
- set_scaled_to_height(value)[Quellcode]#
- set_scaled_to_width(value)[Quellcode]#
- set_upscaled(value)[Quellcode]#
- switch_appearance(source)[Quellcode]#
- Rückgabetyp: