Ejemplo n.º 1
0
    def create_button(image_normal, image_down, x, y, size_x, size_y,
                      toggle_button):
        if toggle_button:
            button = ToggleButton(background_normal=image_normal,
                                  background_down=image_down)
        else:
            button = Button(background_normal=image_normal,
                            background_down=image_down)
        button.size_hint = (size_x, size_y)
        button.pos_hint = {'center_x': x, 'center_y': y}

        return button