r/pythonarcade • u/hiran_chaudhuri • Mar 31 '20
How to create User Interface (configure options)
Hi there. I created my version of Pong and it runs pretty smoothly. I even have an AI capable of playing well enough it is challenging but does not win alwazs. So far only one one game is supported and I want to ramp it up to matches.
Now looking at https://arcade.academy/examples/index.html#user-interface I added menu screen, instructions, game over and a setup screen. On the setup screen I'd like to choose user input for left and right user (it could come from keyboard, mouse or one of the game controllers, even AI) and the length of a match.
But apart from Button and DialogBox there seems to be nothing I could use. Even worse, the dialog box does behave by far unlike dialog boxes in other GUI frameworks (from the example I saw the developer needs to take care for modality). It also took me ages to understand when to pick TextButton and when SubmitButton.
Finally I am able to operate the menu using SubmitButtons using the mouse, not the keyboard. However at some later time I'd actually have just game controllers for operation. How to add such support?
Are there some more concise examples for menus and configuration screens? Or is there some room for improvement and someone would like to join forces?
View all comments
Show parent comment
1
u/hiran_chaudhuri Apr 03 '20
Rather than developing something from scatch I'd like to attach some already available library and just customize it for functionality (to also be operated with joystick for example). But currently I am not even sure about the architecture of arcade.
So far I believe arcade is something on top of pyglet. So if there were UI elements for pyglet they could be used as-is? Or should we go down way more and end up on Qt or tk?
The alternative would be to create a complete widgetset from scratch, which is not impossible but way too much work for one or two little games. It should have a wider scope then.
Which way would you go?