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: bgui.widget.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 = {'HoverImage': (None, 0, 0, 1, 1), 'Default2Image': (None, 0, 0, 1, 1), 'DefaultImage': (None, 0, 0, 1, 1), 'ClickImage': (None, 0, 0, 1, 1)}