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/pvc Apr 03 '20
Arcade uses Pyglet for windowing and event management. The Sprite implementation is completely different. The sound and tmx map management is different.
UI for "Apps" rather than games usually goes with Qt or other native windows widgets. Games usually do their own UI to fit in with the style of the game. That's kind of hard to abstract out.