image.py

Common surface-backed image abstraction used by graphics and UI.

class Image

Description

Lazy, cacheable pygame image. Explicit pixel size takes precedence over scale.

Methods
def __init__(self: Any, source: ImageSource, source_rect: Any = None) -> Any
No documentation
def source(self: Any) -> Any
No documentation
def scale(self: Any) -> Any
No documentation
def size(self: Any) -> Any
No documentation
def alpha(self: Any) -> Any
No documentation
def flip_state(self: Any) -> Any
No documentation
def rotation(self: Any) -> Any
No documentation
def _dirty(self: Any) -> Any
No documentation
def set_scale(self: Any, scale: Any) -> Any
No documentation
def set_size(self: Any, size: Any) -> Any
No documentation
def set_alpha(self: Any, alpha: Any) -> Any
No documentation
def set_source_rect(self: Any, rect: Any) -> Any
No documentation
def set_filter(self: Any, name: Any, **params: dict) -> Any
No documentation
def clear_filters(self: Any) -> Any
No documentation
def set_mask(self: Any, mask: Any) -> Any
No documentation
def set_flip(self: Any, flip_x: bool = False, flip_y: bool = False) -> Any
Mirror the image horizontally (flip_x) and/or vertically (flip_y).
def flip(self: Any, x: bool = False, y: bool = False) -> Any
Flip the image: `x` mirrors left/right, `y` mirrors top/bottom.
def set_rotation(self: Any, angle: float, angle_type: AngleType = 'Degree') -> Any
Rotate counter-clockwise around the centre. `angle_type` is 'Degree' or 'Radian'.
def rotate(self: Any, angle: float, angle_type: AngleType = 'Degree') -> Any
Rotate counter-clockwise around the centre (defaults to degrees).
def clear_transform(self: Any) -> Any
Reset any flip/rotation applied to this image.
def get_surface(self: Any) -> Any
No documentation
def get_size(self: Any) -> Any
No documentation
def tostring(self: Any, format: Optional[_to_string_format] = 'RGBA') -> Tuple[str, Union[Tuple[int, int], Tuple[float, float]]]
No documentation
def fromstring(string: str, size: Union[Tuple[int, int], Tuple[float, float]], format: Optional[_to_string_format] = 'RGBA') -> Image
No documentation
def _apply_filter(self: Any, surface: Any, name: Any, params: Any) -> Any
No documentation
def copy(self: Any) -> Any
No documentation
def __getattr__(self: Any, name: Any) -> Any
No documentation
def __repr__(self: Any) -> Any
No documentation
Back to Graphics Module