def __init__(self, parent, rect, text='Button', click=None):
    super(BFButton, self).__init__()
    (self.x, self.y, self.width, self.height) = rect
    self.bg_color = (225, 225, 225)
    self.parent = parent
    self.surface = parent.subsurface(rect)
    self.is_hover = False
    self.in_click = False
    self.click_loss_time = 0
    self.click_event_id = (- 1)
    self.ctl_id = BFControlId().instance().get_new_id()
    self._text = text
    self._click = click
    self.init_font()
def __init__(self, parent, rect, text='Button', click=None):
    super(BFButton, self).__init__()
    (self.x, self.y, self.width, self.height) = rect
    self.bg_color = (225, 225, 225)
    self.parent = parent
    self.surface = parent.subsurface(rect)
    self.is_hover = False
    self.in_click = False
    self.click_loss_time = 0
    self.click_event_id = (- 1)
    self.ctl_id = BFControlId().instance().get_new_id()
    self._text = text
    self._click = click
    self.init_font()