Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pygame Menu Flicker #31

Open
ztnel opened this issue Dec 3, 2021 · 1 comment
Open

Pygame Menu Flicker #31

ztnel opened this issue Dec 3, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@ztnel
Copy link
Member

ztnel commented Dec 3, 2021

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.

@ztnel ztnel added the bug Something isn't working label Dec 3, 2021
@ztnel
Copy link
Member Author

ztnel commented Dec 3, 2021

Legacy monitor ui was tested on the same hardware and appears to work properly

@ztnel ztnel mentioned this issue Dec 4, 2021
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant