I want to create a little game and I want to make a GUI of hexagonals buttons but I actually don't find a good library except Turtle that looks not really good to make buttons and PyQt that isn't working on Python 3.10.
If you have any idea of library that can do it or another method, thanks for helping !
Related
I am trying to make a GUI in python that only consists of 1 window. I think this is better explained with examples. If you have say the settings app open on the computer when you click an option a new window doesn't pop up, the original window changes the a new layout. Is there a way to do this without deleting everything in the window and then adding new stuff, and when going back doing the same process.
If you're using a QT based gui framework like PyQT or PySimpleGUI, you can accomplish this task using a Tab object. Here is a link to a sample program with using Tabs in PySimpleGUI
PySimpleGUI is a really good option for getting your feet wet with GUI development in Python. You can get a lot done with very little code and learn about how GUI's work.
So I am trying to make a python script that when I do a certain hotkey combination, It shows a text box as an overlay like what "Geforce Experience" and "Windows Gamebar" do.
the problem is that in the game when I interact with the text-area loses focus and goes minimized as opposed to the 2 programs I spoke about before, for example windows game bar allows you interact with a lot of options while the game is still on foreground and you close the bar you are left with whatever you were with before...
I'm using tkinter for now, and if there are solution not including tkinter it is Ok as long as it achives the goal.
As far as I understand what you are trying to do is create a overlay for a game and the overlay should be created using tkinter object. Here is a library that can do that, however as far as I remember you needed to change something in it's python file, however this might have already been fixed.
my question is quite simple, but I can't move on until I solve it. I want to develop a card game, something like Magic the Gathering. I suppose there will be just a little of animation, but much work with images, image transformation and special rendering - some kind of things, that every unit has now attack plus 2 so cards on table will adapt.
I thought Python will be best for it, because it easy to develop with it and I know it pretty well. Also I have a little of experience with PyQt and Pygame. But I can't decide which one is better for that purpose. What do you think will be easier to use: PyQt, Pygame or something else?
if you want just a simple animation and want to finish your game fast. use the pyqt's scene view. refer to (Rapid GUI programming using python and pyqt) book if you want to learn more about scene view.
PySolitaire is a collection of more than 300 solitaire and Mahjongg games. So maybe if you browse around, perhaps you can get some idea.
What is better? If you are developing games, PyGame I guess.
Both pygame and pyqt will work for what you want to do, but I'd recommend pyqt: you'll be able to use standard widgets (like listboxes, textboxes, menus, buttons, ...).
I've never worked with pyqt myself, but I image that drag 'n drop is something built-in, which will be really useful for a card game.
With pygame on the other hand you'll have to make everything yourself. This will give it more of a game feel as you can draw everything exactly like you want it to look like, but it'll take more work as you have to implement basic stuff yourself.
Here's the deal. I'm trying to write an arkanoid clone game and the thing is that I need a window menu like you get in pyGTK. For example File->(Open/Save/Exit) .. something like that and opening an "about" context where the author should be written.
I'm already using pyGame for writting the game logic. I've tried pgu to write the GUI but that doesn't help me, altough it has those menu elements I'm taking about, you can't include the screen of the game in it's container.
Does anybody know how to include such window menus with the usage of pyGame ?
wxPython allows you to integrate a Pygame window inside of a "normal" wxPython window - check out their wiki entry for how to do it. This should allow you to have a normal window (with File/Help/etc.) menus, but have a Pygame surface to which you can draw for your game.
I have been playing around with writing some simple card games in Python for fun and I would like to add a graphical user interface (GUI) to the games. Which library would you recommend for writing the GUI for a simple card game?
If all you want is a GUI, wxPython should do the trick.
If you're looking to add sound, controller input, and take it beyond a simple card game, then you may want to use pygame.
I haven't used wxPython, but Pygame by itself is rather low-level. It allows you to catch key presses, mouse events and draw stuff on the screen, but doesn't offer any pre-made GUI controls. If you use Pygame, you will either have to write your own GUI classes or use existing GUI extensions for Pygame, like Phil's Pygame Utilities.
Generally, PyGame is the better option for coding games. But that's for the more common type of games - where things move on the screen and you must have a good "frame-rate" performance.
For something like a card game, however, I'd go with wxPython (or rather, PyQt). This is because a card game hasn't much in terms of graphics (drawing 2D card shapes on the screen is no harder in wx / PyQt than in PyGame). And on the other hand, you get lots of benefits from wx - like a ready-made GUI for interaction.
In Pygame you have to create a GUI yourself or wade through several half-baked libraries that do it for you. This actually makes sense for Pygame because when you create a game you usually want a GUI of your own, that fits the game's style. But for card games, most chances are that wx's standard GUI widgets will do the trick and will save you hours of coding.
The answers to this related question may be very useful for you:
What can Pygame do in terms of graphics that wxPython can't?
I'd say pygame -- I've heard it's lots of fun, easy and happy. Also, all of my experiences with wxPython have been sad an painful.
But I'm not bias or anything.
pygame is the typical choice, but pyglet has been getting a lot of attention at PyCon. Here's a wiki entry on Python Game libraries: http://wiki.python.org/moin/PythonGameLibraries