def __init__(self, x, y, w, h): UiElement.__init__(self, x, y, w, h) self.color = (0, 0, 255) UiElement.set_event(self, "hover_in", self.on_hover_in) UiElement.set_event(self, "hover_out", self.on_hover_out) UiElement.set_event(self, "click", self.on_click) UiElement.set_event(self, "release", self.on_release) self.is_hover = False self.is_clicked = False
def __init__(self, x, y, w, h, filename): UiElement.__init__(self, x, y, w, h) UiElement.set_event(self, "hover_in", self.on_hover_in) UiElement.set_event(self, "hover_out", self.on_hover_out) UiElement.set_event(self, "click", self.on_click) UiElement.set_event(self, "release", self.on_release) self.is_hover = False self.is_clicked = False self.sprite_idle = Sprite(x, y, filename + "_idle.png", False) self.sprite_hover = Sprite(x, y, filename + "_hover.png", False) self.sprite_click = Sprite(x, y, filename + "_click.png", False) self.current_sprite = self.sprite_idle
def __init__(self, x, y, w, h, filename): UiElement.__init__(self, x, y, w, h) #self.color = (0, 0, 255) UiElement.set_event(self, "hover_in", self.on_hover_in) UiElement.set_event(self, "hover_out", self.on_hover_out) UiElement.set_event(self, "click", self.on_click) UiElement.set_event(self, "release", self.on_release) self.is_hover = False self.is_clicked = False self.sprite_idle = Sprite(x, y, 'Button_idle.png', False) self.sprite_hover = Sprite(x, y, 'Button_hover.png', False) self.sprite_click = Sprite(x, y, 'Button_click.png', False) self.current_sprite = self.sprite_idle #defines the current button that will be drawn
def __init__(self, x, y, w, h): UiElement.__init__(self, x, y, w, h) self.color = (255, 255, 255) UiElement.set_event(self, "hover_in", self.on_hover_in) UiElement.set_event(self, "hover_out", self.on_hover_out) self.is_hover = False