![]() Using the isOver(pos) function, you can check if a given position ( (x, y) tuple, most likely the position of the mouse) is over the button, associating all kinds of pygame events to it ( pygame.MOUSEBUTTONDOWN, pygame.MOUSEMOTION). font: name of the font to use (make sure it is installed in your system)īutton Creating a button: import PygameUtils as puīut = pu.button(color, x, y, width, height).You can run the example.py file to get a general idea of what the widgets look like as well as using it as a reference or template. In almost every widget you don't need to specify every single attribute, default values are used instead. To use it simply call yourWidget.draw(win), where yourWidget corresponds to your widget name and win corresponds to your pygame display. So far there are 2 widgets: button and checkboxĮvery widget has a draw function, that draws the widget. Use the package manager pip to install Pygame Utils. ![]() A compilation of utility tools (mainly widgets: buttons, checkboxes.) to use with pygame.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |