Skip to content

Pygame Menu Flicker #31

@ztnel

Description

@ztnel

Description

Menu flicker was introduced during some point of the pygame ui transition. The exact cause is unknown but the menu redraw function has 2 gfx overlay draw functions shown below:

    def draw(self):
        """
        Draw menu to surface.

        :return: None
        """
        # Draw background rectangle
        _gfxdraw.filled_polygon(self._surface, self._bgrect,
                                self._bgcolor)
        # Draw title
        _gfxdraw.filled_polygon(self._surface, self._title_polygon_pos,
                                self._bg_color_title)

When these lines are commented out the menu is static and has no redraw however it still operates properly with no flicker. The culprit is related to the pygame surface fills in-between frame redraws.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions