Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
SwashbucklerXX
- Newbie
- Posts: 16
- Joined: Tue Sep 03, 2019 6:37 pm
- Projects: Made Marion: A Robin Hood Romance
-
Contact:
#1
Post
by SwashbucklerXX » Sat Apr 11, 2020 3:24 pm
Hiya! I've cobbled together some scrolling credits by borrowing code from the all-in-one GUI (thanks Tofurocks and pals!). They're working great, but there's a long lag time before the first credit appears at the bottom of the screen... so for 10 seconds or so, the player just sees my background and some music playing. My beta testers worried that the game had crashed until the credits finally appeared.
Have I done something wrong or is there a way to tweak the code so the credits appear more quickly at the start? I don't think I'm scrolling them particularly slowly, and the credits length is correct - final credit is about halfway up the screen when the scroll ends. I have pared the code down a bit, so maybe I left something out?
Transform code:
Code: Select all
transform credits_scroll(speed):
ypos 3600
linear speed ypos -3600
Screens code:
Code: Select all
screen credits():
style_prefix "credits"
key "K_ESCAPE" action NullAction()
key "K_MENU" action NullAction()
key "mouseup_3" action NullAction()
if persistent.credits_seen:
textbutton _("Skip End Credits") action Jump("skip_credits") xalign 1.0 yalign 1.0
frame at credits_scroll(25.0):
background None
xalign 0.5
-
Per K Grok
- Miko-Class Veteran
- Posts: 882
- Joined: Fri May 18, 2018 1:02 am
- Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
- itch: per-k-grok
- Location: Sverige
-
Contact:
#2
Post
by Per K Grok » Sun Apr 12, 2020 12:51 am
SwashbucklerXX wrote: ↑Sat Apr 11, 2020 3:24 pm
Hiya! I've cobbled together some scrolling credits by borrowing code from the all-in-one GUI (thanks Tofurocks and pals!). They're working great, but there's a long lag time before the first credit appears at the bottom of the screen... so for 10 seconds or so, the player just sees my background and some music playing. My beta testers worried that the game had crashed until the credits finally appeared.
Have I done something wrong or is there a way to tweak the code so the credits appear more quickly at the start? I don't think I'm scrolling them particularly slowly, and the credits length is correct - final credit is about halfway up the screen when the scroll ends. I have pared the code down a bit, so maybe I left something out?
Transform code:
Code: Select all
transform credits_scroll(speed):
ypos 3600
linear speed ypos -3600
Screens code:
Code: Select all
screen credits():
style_prefix "credits"
key "K_ESCAPE" action NullAction()
key "K_MENU" action NullAction()
key "mouseup_3" action NullAction()
if persistent.credits_seen:
textbutton _("Skip End Credits") action Jump("skip_credits") xalign 1.0 yalign 1.0
frame at credits_scroll(25.0):
background None
xalign 0.5
My guess is that the scrolling starts way below the bottom of the game screen and the delay until it is shown is due to it first having to work it's way up to the screen.
Test changing the start position.
-
SwashbucklerXX
- Newbie
- Posts: 16
- Joined: Tue Sep 03, 2019 6:37 pm
- Projects: Made Marion: A Robin Hood Romance
-
Contact:
#3
Post
by SwashbucklerXX » Sun Apr 12, 2020 1:45 am
Per K Grok wrote: ↑Sun Apr 12, 2020 12:51 am
My guess is that the scrolling starts way below the bottom of the game screen and the delay until it is shown is due to it first having to work it's way up to the screen.
Test changing the start position.
Thanks! Sorry, I'm a bit of a noob, but do you have a suggestion for how I could do that within this format?
I have to keep the current numbers in the transform the way they are because otherwise it won't show the entire credits (3600 is the approximate pixel height of the credits text). So I'm not quite sure how to tell Renpy to take this chunk of text and start it right below the screen, but then scroll through all of it.
-
Per K Grok
- Miko-Class Veteran
- Posts: 882
- Joined: Fri May 18, 2018 1:02 am
- Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
- itch: per-k-grok
- Location: Sverige
-
Contact:
#4
Post
by Per K Grok » Sun Apr 12, 2020 2:30 am
SwashbucklerXX wrote: ↑Sun Apr 12, 2020 1:45 am
Per K Grok wrote: ↑Sun Apr 12, 2020 12:51 am
My guess is that the scrolling starts way below the bottom of the game screen and the delay until it is shown is due to it first having to work it's way up to the screen.
Test changing the start position.
Thanks! Sorry, I'm a bit of a noob, but do you have a suggestion for how I could do that within this format?
I have to keep the current numbers in the transform the way they are because otherwise it won't show the entire credits (3600 is the approximate pixel height of the credits text). So I'm not quite sure how to tell Renpy to take this chunk of text and start it right below the screen, but then scroll through all of it.
It is the height of the screen that counts for setting the starting point, not the height of the the text. The height of the text is important for when to stop the scrolling.
-
strayerror
- Regular
- Posts: 154
- Joined: Fri Jan 04, 2019 3:44 pm
-
Contact:
#5
Post
by strayerror » Sun Apr 12, 2020 3:11 pm
Assuming that the
frame containing the credits is correctly sized (it should be, Ren'Py should expand it to include all your text), you can use this tweaked transform to start with the top of the frame aligned with the bottom of the screen, and slowly move up until the bottom of the frame is aligned with the top of the screen. This should ensure a hidden start and end point, with the credits peeking almost immediately and a smooth transition up the screen.
Code: Select all
transform credits_scroll(speed):
subpixel True
yanchor 0. ypos 1.
linear speed yanchor 1. ypos 0.
-
SwashbucklerXX
- Newbie
- Posts: 16
- Joined: Tue Sep 03, 2019 6:37 pm
- Projects: Made Marion: A Robin Hood Romance
-
Contact:
#6
Post
by SwashbucklerXX » Tue Apr 14, 2020 1:12 am
strayerror wrote: ↑Sun Apr 12, 2020 3:11 pm
Assuming that the
frame containing the credits is correctly sized (it should be, Ren'Py should expand it to include all your text), you can use this tweaked transform to start with the top of the frame aligned with the bottom of the screen, and slowly move up until the bottom of the frame is aligned with the top of the screen. This should ensure a hidden start and end point, with the credits peeking almost immediately and a smooth transition up the screen.
Code: Select all
transform credits_scroll(speed):
subpixel True
yanchor 0. ypos 1.
linear speed yanchor 1. ypos 0.
That did the trick, thank you very much!
Users browsing this forum: Google [Bot]