So I'm making this game with Kivy and it's a game where there's a start screen with an MDToolbar
, an MDNavigationDrawer
, two Image
s, three MDLabel
s and a OneLineIconListItem
that says 'Start Game' and when you click on it the game is supposed to start.
The game screen contains:
MDLabel
Issues:
I used on_touch_down
, on_touch_move
, and on_touch_up
for this game and I know that's what's causing the MDFlatButton
issue. So does anyone know how I'm supposed to have the on_touch_*
methods defined AND have clickable buttons?
And I don't know how to fix the ScreenManager
issue either.
I know I haven't provided any code here, but that's because this post is getting too long. I already got a post deleted because people thought the post was too long and I was providing too much code and too less details. And I don't want that to happen again. If anyone needs to view the code of my project, I will leave a Google Docs link to it.
Thanks in advance!
I fixed my app.
Just in case anyone had the same question, I'm gonna post the answer here.
To get a clickable button, you have to create a new
Screen
orWidget
and add the actual screen as a widget to the new class. Then, you can add buttons to the new class. This works because the button is on top of the actual screen. So when you click anywhere in the button's area, the button gets clicked and theon_touch_*
methods of the actual screen don't get called.
And to fix the
ScreenManager
issue, you just have to expirement.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.