Migration Guide - v2 to v3¶
- Removed from library
- Renamed library
pygameMenutopygame_menu - Removed all configuration variables from
pygameMenu.config - Removed
TextMenu, useMenuandadd_label()method instead
- Renamed library
- New Menu behaviour
- Menu manage the event loop and drawing using
Menu.mainloop(surface, bgfun, disable_loop=False, fps_limit=0) - User’s application manage the event loop, using
Menu.update(events)andMenu.draw(surface)
- Menu manage the event loop and drawing using
- Removed from Menu class
add_option(), useadd_button()insteadset_fps(), usefps_limitfrommainloop()instead- Constructor parameters:
bgfun, now this function is required byMenu.mainloop()color_selected, moved toselection_colorofpygame_menu.themes.Themedopause, now user can control this behaviour usingupdate()ormainloop()draw_region_x, moved towidget_offsetofpygame_menu.themes.Themedraw_region_y, moved towidget_offsetofpygame_menu.themes.Themedraw_select, moved towidget_selection_effectofpygame_menu.themes.Themefont_color, moved towidget_font_colorofpygame_menu.themes.Themefont_size_title, moved totitle_font_sizeofpygame_menu.themes.Themefont_size, moved towidget_font_sizeofpygame_menu.themes.Themefont_title, moved totitle_fontofpygame_menu.themes.Themefont, moved towidget_fontofpygame_menu.themes.Themefps, usefps_limitfrommainloop()insteadmenu_alpha, now each color ofpygame_menu.themes.Themecan be defined with opacitymenu_color_title, moved totitle_background_colorofpygame_menu.themes.Thememenu_color, moved tobackground_colorofpygame_menu.themes.Thememenu_height, useheightmenu_width, usewidthoption_margin, moved towidget_marginofpygame_menu.themes.Themeoption_shadow_offset, moved towidget_shadow_offsetofpygame_menu.themes.Themeoption_shadow_position, moved towidget_shadow_positionofpygame_menu.themes.Themeoption_shadow, moved towidget_shadowofpygame_menu.themes.Themerect_width, now change selection effect frompygame_menu.themes.Themesurface, now pygame surface is only required bymainloop()andupdate()title_offsetx, moved totitle_offsetofpygame_menu.themes.Themetitle_offsety, moved totitle_offsetofpygame_menu.themes.Themewindow_widthandwindow_heightparameters
- Renamed Menu method parameters
element_nameandelementfromadd_button()totitleandactionvaluesfromadd_selector()toitemswidget_idfromadd_button()tobutton_id