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

Unable to transition screen more than once #71

Closed
vmckla opened this issue Aug 8, 2019 · 4 comments
Closed

Unable to transition screen more than once #71

vmckla opened this issue Aug 8, 2019 · 4 comments
Labels

Comments

@vmckla
Copy link

vmckla commented Aug 8, 2019

I want to implement 3 menu screen transitions with the following code.

menu3 = MenuTemplate(surface=SURFACE, title="menu3")
menu3.add_option("back", pygameMenu.events.BACK)

menu2 = MenuTemplate(surface=SURFACE, title="menu2")
menu2.add_option("go to menu3", menu3)

menu1 = MenuTemplate(surface=SURFACE, title="menu1")
menu1.add_option("go to menu2", menu2)

clock = pygame.time.Clock()
while True:
    clock.tick(60)
    menu1.mainloop()

MenuTemplate is an inherited class of pygameMenu.Menu.

I expect following screen transitions:

menu1 -> menu2 -> menu3

In practice, however, only the transition from menu1 to menu2 works and cannot transition from menu2 to menu3.

Is this the intended behavior? Or is it a bug?

@ppizarror
Copy link
Owner

It's a bug, I think I've fixed this. Can you test the new menu.py file?

@ppizarror
Copy link
Owner

example
I've updated the example too (examples/game_selector.py)

@vmckla
Copy link
Author

vmckla commented Aug 8, 2019

Thanks!
It works I intended!

@vmckla vmckla closed this as completed Aug 8, 2019
@ppizarror
Copy link
Owner

I'll post this patch (2.0.3) to PyPi. Let me know if you find any other bug related to menu open/back events 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants