Current code:
Code: Select all
## Transitions used to show and hide the dialogue window
define config.window_show_transition = Dissolve(.5)
define config.window_hide_transition = Dissolve(.5)
https://i.imgur.com/4jachbY.mp4
Code: Select all
## Transitions used to show and hide the dialogue window
define config.window_show_transition = Dissolve(.5)
define config.window_hide_transition = Dissolve(.5)
Code: Select all
window:
at slide_updown
Code: Select all
transform slide_updown():
yalign 1.0
on show:
yoffset 300 alpha 0.0
easein 0.5 yoffset 0 alpha 1.0
on hide:
yoffset 0 alpha 1.0
easeout 0.5 yoffset 300 alpha 0.0
on replace:
yoffset 0 alpha 1.0
easeout 0.5 yoffset 300 alpha 0.0
screen say(who, what):
style_prefix "say"
window:
at slide_updown
id "window"
Code: Select all
## Say screen ##################################################################
##
## The say screen is used to display dialogue to the player. It takes two
## parameters, who and what, which are the name of the speaking character and
## the text to be displayed, respectively. (The who parameter can be None if no
## name is given.)
##
## This screen must create a text displayable with id "what", as Ren'Py uses
## this to manage text display. It can also create displayables with id "who"
## and id "window" to apply style properties.
##
## https://www.renpy.org/doc/html/screen_special.html#say
init -2:
style say_thought:
line_spacing -10
style say_dialogue:
line_spacing -10
screen say(who, what):
style_prefix "say"
window:
id "window"
at slide_updown
if who is not None:
window:
id "namebox"
style "namebox"
text who id "who"
text what id "what"
I tried out your transform but unfortunately the "on replace" doesn't seem to work no matter what I put in. The textbox just slides up and down for each dialogue. I changed it to "on replaced" as well but that doesn't work either.jeffster wrote: ↑Sun Jan 09, 2022 8:07 pmCode: Select all
transform slide_updown(): yalign 1.0 on show: yoffset 300 alpha 0.0 easein 0.5 yoffset 0 alpha 1.0 on hide: yoffset 0 alpha 1.0 easeout 0.5 yoffset 300 alpha 0.0 on replace: yoffset 0 alpha 1.0 easeout 0.5 yoffset 300 alpha 0.0
Code: Select all
on replaced:
linear 0.5 alpha 0.0
linear 0.5 alpha 1.0
Try this wayoatnoodles wrote: ↑Tue Jan 11, 2022 12:08 pm Thanks for the reply. I tried adding the first part of the code you recommended in the say section of screens.rpy, but I get an error when dialogue happens ("Exception: The say screen (or show_function) must return a Text object."). I'm not sure if I put it in the right place, but just adding "window: at slide_updown" to the say section separately doesn't work.
Code: Select all
screen say:
style_prefix "say"
window at textbox_slide:
id "window"
I have no idea what to do about that. Maybe just leave some "on show" effect, as actually transitions between text pieces do irritate people. Players want to read fast, they don't want to see those beautiful effects again and again. At least I prefer no transitions, no delays when I click through a VN. So maybe they should be reserved only for some special effect cases...Dark12ose wrote: ↑Tue Jan 11, 2022 1:57 pm I tried out your transform but unfortunately the "on replace" doesn't seem to work no matter what I put in. The textbox just slides up and down for each dialogue. I changed it to "on replaced" as well but that doesn't work either.
Also there's a blank textbox sliding in before the actual textbox with dialogue shows up at the start of the game and whenever a scene changes but I think that's a renpy thing? As it does the same thing when trying to customize textbox for each characters unless it's manually done.
That's true. I myself like to read things fast but I really liked the effect done in "NightShade" otome game and thought it was pretty cool so wanted to try it out haha.jeffster wrote: ↑Tue Jan 11, 2022 4:45 pm I have no idea what to do about that. Maybe just leave some "on show" effect, as actually transitions between text pieces do irritate people. Players want to read fast, they don't want to see those beautiful effects again and again. At least I prefer no transitions, no delays when I click through a VN. So maybe they should be reserved only for some special effect cases...
That worked, thank you.Try this wayinstead of placing it after the : (the colon). It works that way for me though I am having the problem above.Code: Select all
screen say: style_prefix "say" window at textbox_slide: id "window"
You're welcome. Glad it helped. ^^oatnoodles wrote: ↑Tue Jan 11, 2022 7:50 pmThat worked, thank you.Try this wayinstead of placing it after the : (the colon). It works that way for me though I am having the problem above.Code: Select all
screen say: style_prefix "say" window at textbox_slide: id "window"
Exactly, that was what I wanted as well but unfortunately the "on replace" does not work at all. If it did it would have done exactly what we both intended :/As for the transform itself, yeah it is kind of annoying. My intention was for the sliding to only happen when the window first shows. As in, if there's another line of dialogue (or multiple) after the first, the sliding in will only happen with the first line of dialogue and the last. It shows this in the example.
I'm still hopeful we could get it working somehow... maybe the transform code needs to be different. To be honest, I just don't have enough knowledge or skill with Ren'py yet to know what else would work. Maybe someone else has an answer.Exactly, that was what I wanted as well but unfortunately the "on replace" does not work at all. If it did it would have done exactly what we both intended :/
Unfortunately I am in the same boat with the lack of knowledge myself. Though, I'll try different transforms with the little knowledge that I have and update this if I come up with anything.oatnoodles wrote: ↑Tue Jan 11, 2022 8:09 pm I'm still hopeful we could get it working somehow... maybe the transform code needs to be different. To be honest, I just don't have enough knowledge or skill with Ren'py yet to know what else would work. Maybe someone else has an answer.
It's possible to use conditions in screens. For example, this will show the slide effect only when "Eileen" speaks:oatnoodles wrote: ↑Tue Jan 11, 2022 7:50 pm My intention was for the sliding to only happen when the window first shows. As in, if there's another line of dialogue (or multiple) after the first, the sliding in will only happen with the first line of dialogue and the last. It shows this in the example.
The issue of the duplicate text box is happening to me too, not sure how to fix that.
Code: Select all
transform slide_updown():
on show:
yoffset 300 alpha 0.0
easein 0.5 yoffset 0 alpha 1.0
screen say(who, what):
style_prefix "say"
if who == "Eileen":
window at slide_updown:
id "window"
if who is not None:
window:
id "namebox"
style "namebox"
text who id "who"
text what id "what"
## If there's a side image, display it above the text. Do not display on the
## phone variant - there's no room.
if not renpy.variant("small"):
add SideImage() xalign 0.0 yalign 1.0
else:
window:
id "window"
if who is not None:
window:
id "namebox"
style "namebox"
text who id "who"
text what id "what"
This would work if not for the fact that the first speaker's textbox would need to do the transform. Also it causes the transform everytime Eileen is talking as well since that's what the condition is telling it to do so that I understand why. It would be useful when trying out different things specific for that character though.jeffster wrote: ↑Wed Jan 12, 2022 3:11 pm It's possible to use conditions in screens. For example, this will show the slide effect only when "Eileen" speaks:
(Also double effect doesn't happen if it's not Eileen that speaks first.)
Code: Select all
transform slide_updown(): on show: yoffset 300 alpha 0.0 easein 0.5 yoffset 0 alpha 1.0 screen say(who, what): style_prefix "say" if who == "Eileen": window at slide_updown: id "window" if who is not None: window: id "namebox" style "namebox" text who id "who" text what id "what" ## If there's a side image, display it above the text. Do not display on the ## phone variant - there's no room. if not renpy.variant("small"): add SideImage() xalign 0.0 yalign 1.0 else: window: id "window" if who is not None: window: id "namebox" style "namebox" text who id "who" text what id "what"
As for the callback from what I can understand, only one def can be placed within the define config.say_arguments_callback?It's probably possible to have the slide effect only for certain lines, using characters with arguments (and maybe config.say_arguments_callback):
https://www.renpy.org/doc/html/dialogue ... -arguments
I think maybe config.say_arguments_callback is designed basically for preparing variables, so that we can set something short and simple likeDark12ose wrote: ↑Wed Jan 12, 2022 10:09 pm As for the callback from what I can understand, only one def can be placed within the define config.say_arguments_callback?
So what I was thinking, looking at it, was that have one set to "on show" and one "on hide" and than place it manually if not automated onto the dialogue.
Code: Select all
e "Saying" (s = 1)
Code: Select all
what_color = "#FFEEDDCC"
what_size = 38
Code: Select all
screen say(who, what, s = 0):
style_prefix "say"
if s == 1:
on "show":
#...
The basic functionality of say screen is simple, so it should be possible to use some custom screen instead. Maybe even(I certainly don't mind doing things manually if that means I get the result that I want.)
I also realized that the "on replace" wasn't working because there's nothing being replaced. The textbox show and hide with each dialogue never replacing. Unless there is a python that can change all that but my python knowledge is at the very basic level and learning seem to be a really slow process .
Code: Select all
screen say(who, what, s = 0):
style_prefix "say"
if s == 1:
use say_sliding
#...
else:
window:
#...
It seems that using window hide (or config.window) before dialogue lines removes the double textbox effect.Edit: I looked more closely at the textbox in the default GUI and the double textbox IS a renpy thing. It does it even in the default GUI with or without the dissolve transition. It's just becomes more apparent when you are trying to change colors and such. In other words we can't do anything about the double textbox unless you change the textboxes manually (which for some reason stops the double textboxing).
I changed some of my code, and I'm happy with the results now. It might not be 100% what I was looking for, but whatever lol.It seems that using window hide (or config.window) before dialogue lines removes the double textbox effect.
Code: Select all
# The dialogue window transformation.
# Fades in and eases from the bottom.
transform WindowEaseBottom:
on show:
alpha 0.0
parallel:
linear 0.5 alpha 1.0
parallel:
xalign 0.5 yalign 1.0
linear 0.5 yoffset -10
on hide:
alpha 1.0
parallel:
xalign 0.5 yalign 1.0
linear 0.5 yalign 1.0 yoffset -30
parallel:
linear 0.5 alpha 0.0
Users browsing this forum: DewyNebula