Actor > Costume#
A Costume is a child class of Appearance.
Most methods and attributes are inherited from the Appearance base class.
API Reference#
- class miniworlds.appearances.costume.Costume(*args, **kwargs)[source]#
Appearance for an actor.
A costume contains one or more images and defines how an actor looks. You can switch images in a costume to animate the actor.
- Parameters:
actor – Optional actor to attach the costume to.
source – Optional image path, surface, color tuple, or list of image sources.
Examples
actor.add_costume("images/player.png") costume = Costume() costume.add_image("images/walk1.png") actor.add_costume(costume) costume = Costume(actor, "images/player.png")
- animation_length#
- draw_images#
- draw_shapes#
- font_manager#
- id#
- image_manager: image_manager.ImageManager#
- property info_overlay#
Whether to draw a debug overlay around the actor.
Examples
actor.costume.info_overlay = True
- Type:
- initialized#
- last_image#
- loop#
- parent#
the parent of a costume is the associated actor.
- set_image(source)[source]#
Select the active costume image.
- Return type:
- Parameters:
source – Image index, appearance, or color tuple.
- Returns:
True if the image exists.
Examples
costume.set_image(0)
- surface_loaded#
- transformations_manager#