I'd prefer not to make the player click on the images just hover over it. (if i work with click not hover I probably (99% sure) could do it with jump to a label where I play the sound then call the whole "label catmusic" again, so the same things will be displayed.)
This is the code I'm using now for the testing:
Code: Select all
image bg one:
"images/cats/mother cat/mothercat.png"
size(128,72)
image bg two:
"images/cats/bogyó/bogyo.png"
size(128,72)
default bg_toggle1 = False
screen bg_swap1:
if bg_toggle1:
add "bg one"
else:
add "bg two"
textbutton "SWAP BGS":
action NullAction()
hovered [SetVariable("bg_toggle1",True), With(dissolve), renpy.play("music/cat1.mp3")]
unhovered [SetVariable("bg_toggle1",False), With(dissolve)]
xalign 0.5
yalign 0.5
image one:
"images/cats/mother cat/mothercat.png"
size(128,72)
xalign 0.2
yalign 0.2
image two:
"images/cats/bogyó/bogyo.png"
size(128,72)
xalign 0.2
yalign 0.2
default bg_toggle2 = False
screen bg_swap2:
if bg_toggle2:
add "two"
else:
add "one"
textbutton "SWAP cat":
action NullAction()
hovered [SetVariable("bg_toggle2",True), With(dissolve), renpy.play("music/cat4.mp3")]
unhovered [SetVariable("bg_toggle2",False), With(dissolve)]
xalign 0.3
yalign 0.5