0

I need help :D ,

I made a minesweeper game with pygame and I'm looking for some days how to add a menubar at the top of my screen. I 've heard about Tkinter , wxPython , PyGTK ... I also looked at other topic about this but I still do not understand how to do it :/

I'd like to know what are the most appropriate modules and how to do it

Thanks :)

Antclavs
  • 41
  • 6
  • If you're already using PyGame I really don't see the point in using a separate graphics library to handle specific form elements. Why not just build your own menu bar using PyGame? Create a class that uses PyGame's graphics to render the menu, and PyGame's input system to handle click / hover events. It's really no different from developing the minesweepers game board. –  Apr 20 '16 at 12:46
  • You might find this resource useful for learning how to create menus in PyGame. https://nebelprog.wordpress.com/2013/08/14/create-a-simple-game-menu-with-pygame-pt-1-writing-the-menu-options-to-the-screen/ –  Apr 20 '16 at 12:50
  • Thank you Jacob Persi for your reply, I'll try this :D – Antclavs Apr 20 '16 at 13:35
  • One of the things his code isn't doing it listening for events on the menus, like mousepresses. If you want to do that, you can make your menubar subclass pygame,Surface, and use the get_rect() function to give it a rectangle a and use the rect.collideppoint() to listen for clicks. Sorry if you already know this, I don't know how your game code works, so maybe you have already implemented this in your game. I wrote minesweeper, but it was just a terminal version before I got into pygame, its a good one to write! – marienbad Apr 20 '16 at 14:19

0 Answers0