A clickable button with text and theming support.
category: str = 'button'
_properties: Dict[str, Dict[str, Any]] = {**UIElement._properties, 'text': {'name': 'text', 'key': 'text', 'type': str, 'editable': True, 'description': 'Text displayed on the button.'}, 'font_size': {'name': 'font size', 'key': 'font_size', 'type': int, 'editable': True, 'description': 'Size of the text in pixels.'}, 'font_name': {'name': 'font name', 'key': 'font_name', 'type': Optional[str], 'editable': True, 'description': 'Path to a custom font file.'}, 'background_color': {'name': 'background color', 'key': 'background_color', 'type': Tuple[int, int, int], 'editable': True, 'description': 'Custom RGB background color (overrides theme).'}, 'text_color': {'name': 'text color', 'key': 'text_color', 'type': Tuple[int, int, int], 'editable': True, 'description': 'Custom RGB text color (overrides theme).'}}
def __init__(self: Any, x: int, y: int, width: int, height: int, text: str = '', font_size: int = 20, font_name: Optional[str] = None, pivot: Tuple[float, float] = (0, 0), theme: ThemeType = None, element_id: Optional[str] = None) -> None
def can_focus(self: Any) -> bool
def _get_init_args(self: Any) -> Dict[str, Any]
def set_background_color(self: Any, color: Optional[Tuple[int, int, int]]) -> None
def set_text_color(self: Any, color: Optional[Tuple[int, int, int]]) -> None
def set_text(self: Any, text: str) -> None
def get_text(self: Any) -> str
def update_theme(self: Any, theme_type: ThemeType) -> None
def font(self: Any) -> pygame.font.Font
def set_on_click(self: Any, callback: Callable, *args: tuple, **kwargs: dict) -> None
def set_theme(self: Any, theme_type: ThemeType) -> None
def _get_colors(self: Any) -> UITheme
def update(self: Any, dt: float, inputState: InputState) -> None
def _get_color_for_state(self: Any) -> Tuple[int, int, int]
def _get_text_color(self: Any) -> Tuple[int, int, int]
def render(self: Any, renderer: Renderer) -> None
A clickable button that displays an image instead of text.
category: str = 'button'
_properties: Dict[str, Dict[str, Any]] = {**UIElement._properties, 'image_path': {'name': 'image path', 'key': 'image_path', 'type': Union[str, pygame.Surface], 'editable': False, 'description': 'Path to image file or Surface object.'}}
def __init__(self: Any, x: int, y: int, image_path: Union[str, pygame.Surface], width: Optional[int] = None, height: Optional[int] = None, pivot: Tuple[float, float] = (0, 0), theme: ThemeType = None, element_id: Optional[str] = None) -> None
def can_focus(self: Any) -> bool
def _get_init_args(self: Any) -> Dict[str, Any]
def _load_image(self: Any) -> None
def set_on_click(self: Any, callback: Callable, *args: tuple, **kwargs: dict) -> None
def get_image(self: Any) -> pygame.Surface
def set_image(self: Any, image_path: Union[str, pygame.Surface]) -> None
def update(self: Any, dt: float, inputState: InputState) -> None
def _get_overlay_color(self: Any) -> Optional[Tuple[int, int, int, int]]
def render(self: Any, renderer: Renderer) -> None