Re: Custom dialogue boxes not being cleared when scene or menu statements are used
Posted: Thu Jul 21, 2022 3:31 pm
Thanks for the testing grounds, that was helpful. Still took some time to figure out how to fix those annoying little flashes. But as far as I can see, I have a solution. No need for special treatment of "scene" or "menu" necessary.
In screens.rpy add a line to the say screen:
Code: Select all
# tells us if the background should now fade out (triggered via say screen)
default say_end = False
default say_who = None
init python:
from functools import partial
def chartextbg(char, event, *args, **kwargs):
if event == "begin":
store.say_end = False
store.say_who = char
return
def charBg(st, at):
global say_who
if say_who is None:
return Null(), None
d = AlphaMask(Fixed(At("images/gui/{}_bg.png".format(say_who), dialoguepan)), At("images/gui/dialoguemask.png", maskpos))
return d, None
transform bg_fadein:
on appear:
alpha 0.0
linear 0.2 alpha 1.0
on show:
alpha 0.0
linear 0.2 alpha 1.0
on hide:
alpha 1.0
linear 0.2 alpha 0.0
transform bg_fadeout:
on appear:
alpha 0.0
on show:
alpha 1.0
linear 0.2 alpha 0.0
on hide:
alpha 0.0
screen backgrounds:
# use showif instead of if to make those neat transforms and their events work
showif say_end:
frame at bg_fadeout:
background "bg_chars"
else:
frame at bg_fadein:
background "bg_chars"
Code: Select all
screen say(who, what):
on "hide" action SetVariable("say_end", True)
...
