I’m having an issue where I need to make a DirectButton run multiple commands to properly transition to a later screen. Basically, I want it to load the next page (Which I can do) and I want it to stop the current background music so it can start some new background music (Which I can do) but I can’t get the button to do both. This is really annoying me so I though it’d be a little easier if I asked around. Here’s a quick snippet of code.
def StartToon():
ToonSelect.destroy()
ToonText.destroy()
ExitText.destroy()
ToonSelect1.destroy()
ToonSelect2.destroy()
ToonSelect3.destroy()
ToonSelect4.destroy()
ToonSelect5.destroy()
ToonSelect6.destroy()
ExitButton.destroy()
backgroundMusic = loader.loadSfx("phase_3/audio/bgm/create_a_toon.ogg")
backgroundMusic.setLoop(True)
backgroundMusic.setVolume(0.25)
backgroundMusic.play()
backgroundMusic = loader.loadSfx("phase_3/audio/bgm/tt_theme.ogg")
backgroundMusic.start()
ToonSelect1 = DirectButton(text_font = ToonFont, text_fg = (0.433594, 0.90625, 0.835938, 0.7), text_pos = (0, 0.27), text_scale = (0.10, 0.10, 0.10), text_wordwrap = 5, text_align = TextNode.ACenter, text = "Make A Toon", relief = None, command=(StartToon, backgroundMusic.stop))
There’s more to it already, but I really don’t need to reveal more. Also, bonus points or whatever to whoever realises what I’m trying to make. Also, where it does say the button’s command, that is only my latest attempt, not all I tried.