How to do a scrolling screen for credits?

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.
Post Reply
Message
Author
User avatar
dvemail
Regular
Posts: 35
Joined: Sat May 28, 2016 1:50 pm
Projects: Working on Patronus
IRC Nick: dvemail
Deviantart: ObdurateDemand
Github: dvemail
Contact:

How to do a scrolling screen for credits?

#1 Post by dvemail »

I want to have a screen for credits that's available off the main menu. I can do a static screen with scroll bars, but what I really want is a screen that scrolls. I've seen examples that make use of a label, but I'd prefer to have a standalone screen to do this. Any tips on how to get a screen to scroll?

I already have a working credits screen, but it doesn't scroll on it's own. The methods used to auto-scroll are to "say" text into the main game window, one line at a time with a delay. Am I missing something basic, can I "say" into a specific screen?

User avatar
SuperbowserX
Veteran
Posts: 270
Joined: Sat Jan 07, 2017 3:09 pm
Contact:

Re: How to do a scrolling screen for credits?

#2 Post by SuperbowserX »

IDK how to answer this because I haven't worked with credits aha. Google is your best friend for Ren'py related help. In this case, search "renpy credits" or "renpy scrolling image" to find other posts by other users on this topic, i.e. this one: viewtopic.php?f=51&t=22481

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: How to do a scrolling screen for credits?

#3 Post by Divona »

Something like this?

Code: Select all

## ATL for scrolling screen object. In this case, credits roll.
## Speed is the time for object to move up from initial ypos to finish ypos.

transform credits_scroll(speed):
    ypos 720
    linear speed ypos -720

## Credits screen.

screen credits():
    style_prefix "credits"

    add "#000"

    frame at credits_scroll(5.0):
        background None
        xalign 0.5

        vbox:
            label "Credits"

            null height 20

            hbox:
                text "Role 1"
                text "NAME 1"

            hbox:
                text "Role 2"
                text "NAME 2"


style credits_hbox:
    spacing 40
    ysize 30

style credits_label:
    xalign 0.5

style credits_text:
    xalign 0.5

## Show credits screen.

label start:
    call screen credits
Completed:
Image

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: How to do a scrolling screen for credits?

#4 Post by Imperf3kt »

That looks far better than the old code I was using.

Does it have the 10 second lag like the old code by Leon?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: How to do a scrolling screen for credits?

#5 Post by Divona »

Imperf3kt wrote:That looks far better than the old code I was using.

Does it have the 10 second lag like the old code by Leon?
I have no idea about the old code and whatever cause the lag. The code above simply creates a credits screen, and ATL transform initially put it outside the windows. In this case, my guess of the window height is 720 pixels from the top. Then move them up from ypos 720 to -720 within "speed" which in the example I put in 5.0 seconds.

On a side note, you can also add "timer" to credits screen to see how long the credits will show for before return.

Code: Select all

timer 5.0 action Return()
Completed:
Image

User avatar
dvemail
Regular
Posts: 35
Joined: Sat May 28, 2016 1:50 pm
Projects: Working on Patronus
IRC Nick: dvemail
Deviantart: ObdurateDemand
Github: dvemail
Contact:

Re: How to do a scrolling screen for credits?

#6 Post by dvemail »

Divona wrote:Something like this?

Code: Select all

## ATL for scrolling screen object. In this case, credits roll.
## Speed is the time for object to move up from initial ypos to finish ypos.

transform credits_scroll(speed):
    ypos 720
    linear speed ypos -720

## Credits screen.

screen credits():
    style_prefix "credits"

    add "#000"

    frame at credits_scroll(5.0):
        background None
        xalign 0.5

        vbox:
            label "Credits"

            null height 20

            hbox:
                text "Role 1"
                text "NAME 1"

            hbox:
                text "Role 2"
                text "NAME 2"


style credits_hbox:
    spacing 40
    ysize 30

style credits_label:
    xalign 0.5

style credits_text:
    xalign 0.5

## Show credits screen.

label start:
    call screen credits

This worked perfectly! thanks!

Post Reply

Who is online

Users browsing this forum: henne