image_button¶
- class bgui.image_button.ImageButton(parent, name=None, default_image=None, default2_image=None, hover_image=None, click_image=None, aspect=None, size=[1, 1], pos=[0, 0], sub_theme='', options=0)¶
Bases:
Widget
A clickable image-based button.
- Parameters:
parent – The widget’s parent
name – The name of the widget
default_image – List containing image data for the default state (‘image’, xcoord, ycoord, xsize, ysize)
default2_image – List containing image data for a second default state, which is used for toggling (‘image’, xcoord, ycoord, xsize, ysize)
hover_image – List containing image data for the hover state (‘image’, xcoord, ycoord, xsize, ysize)
click_image – List containing image data for the click state (‘image’, xcoord, ycoord, xsize, ysize)
aspect – Constrain the widget size to a specified aspect ratio
size – A tuple containing the width and height
pos – A tuple containing the x and y position
sub_theme – Name of a sub_theme defined in the theme file (similar to CSS classes)
options – Various other options
- theme_section= 'ImageButton'
- theme_options= {'Default2Image': (None, 0, 0, 1, 1), 'DefaultImage': (None, 0, 0, 1, 1), 'ClickImage': (None, 0, 0, 1, 1), 'HoverImage': (None, 0, 0, 1, 1)}