Material
- class ember.material.Material(alpha: int)
All materials inherit from this class. This base class should not be instantiated.
- UPDATES_EVERY_TICK = False
- alpha: int
The transparency of the material, where 0 is fully transparent and 255 is opaque.
- class ember.material.MaterialWithElementCache(alpha: int)
Materials that have an element cache inherit from this class. This base class should not be instantiated.
- clear_cache() None
- class ember.material.MaterialWithSizeCache(alpha: int)
Materials that have a size cache in addition to an element cache inherit from this class. This base class should not be instantiated.
- clear_cache() None
- class ember.material.Blank(*args, **kwargs)
- class ember.material.Color(color: Color | int | str | tuple[int, int, int] | tuple[int, int, int, int] | Sequence[int], outline: int = 0, alpha: int = 255)
Fills the material area with the specified color.
- outline: int
The thickness of the shape outline. If set to 0, the material will be filled with no outline.
- set_color(color: Color | int | str | tuple[int, int, int] | tuple[int, int, int, int] | Sequence[int]) None
- property color
- class ember.material.AverageColor(hsv_adjustment: Sequence[int] = (0, 0, 0), alpha: int = 255)
- UPDATES_EVERY_TICK = True
- class ember.material.Surface(surface: str | Surface, alpha: int = 255)
A pygame Surface wrapped in a Material.
- surface: Surface
The surface to render.
- class ember.material.ScaledSurface(surface: str | Surface, smooth: bool = True, alpha: int = 255)
Stretches a pygame Surface while preserving the edges of the Surface.
- smooth: bool
If True, pygame.transform.smoothscale is used. If False, pygame.transform.scale is used.
- property surface: Surface
The surface to scale.
- class ember.material.RepeatedSurface(surface: str | ~pygame.surface.Surface, content_x: int | ~ember.position.position.Position | None = <Position(50.0% + 0)>, content_y: int | ~ember.position.position.Position | None = <Position(50.0% + 0)>, alpha: int = 255)
Repeats a Pygame Surface to fill the material area
- property surface: Surface
The surface to scale.
- property content_x: Position
- property content_y: Position
- class ember.material.StretchedSurface(surface: str | Surface | PathLike, edge: int | Sequence[int] = 5, alpha: int = 255)
Stretches a pygame Surface while preserving the edges of the Surface.
- load_surface(surface: str | Surface | PathLike) None
- property edge: Sequence[int]
- class ember.material.Blur(radius: int = 7, method: ~ember.common.BlurMode | None = <ember.common.BlurMode object>, recalculate_each_tick: bool = False, alpha: int = 255)
Applies a gaussian blur to the material’s area. Experimental.
- class ember.material.Layered(*materials: Material | Sequence[Material], alpha: int = 255)
Shapes
- class ember.material.shape.Shape(material: Material | None = None, color: Color | int | str | tuple[int, int, int] | tuple[int, int, int, int] | Sequence[int] | None = None, antialias: bool = False, outline: int = 0, alpha: int = 255)
All shape materials inherit from this class. This base class should not be instantiated.
- set_outline(outline: int) None
“The thickness of the shape outline. If set to 0, the shape will be filled with no outline.”
- set_antialias(value: bool) None
When True, the edges will be anti-aliased.
- property outline
The thickness of the shape outline. If set to 0, the shape will be filled with no outline.
- property antialias
When True, the edges of the shape will be anti-aliased.
- class ember.material.shape.RoundedRect(material: Material | None = None, color: Color | int | str | tuple[int, int, int] | tuple[int, int, int, int] | Sequence[int] | None = None, radius: int = 20, outline: int = 0, antialias: bool = True)
- set_radius(radius: int) None
- property radius
The corner radius, in pixels, of the rounded rectangle.