A
A
alick_alick2018-02-08 18:11:08
Python
alick_alick, 2018-02-08 18:11:08

1. How to flip text in kivy? 2.How to launch the widget when the button is clicked?

Hello. I recently started learning kivy. There are 2 questions.
1. How to display some text flipped 180 degrees on the screen
2. I want to create an application menu. When the button is clicked, another widget should be launched:
Code in Main.py

class Menu(Widget):

    def start1(self):
        return Digits()
    def start2(self):
        return Digits2()

class Digits(Widget):
#текст класса

class Digits2(Widget):
#текст класса

class MainApp(App):
    def build(self):
        return Menu()


MainApp().run()

code in Main.kv
<Menu>:

    Button:
        size: 100, 50
        center_x: root.width / 2
        top: (root.top / 2) + (root.top / 10)
        text: '1 player'

        on_press:
            root.start1()


    Button:
        size: 100, 50
        center_x: root.width / 2
        top: (root.top / 2) - (root.top / 10)
        text: '1 vs 1'

        on_press:
            root.start2()

<Digits>: ...

<Digits2>....

Tried to do so. The press is read, but nothing happens after that.
I will be glad to any advice.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question