How do I create a small popup (hovering) journal for my players?

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
olddog
Newbie
Posts: 18
Joined: Sun Dec 30, 2018 11:27 am
Projects: Kismet, a TF/TG game
Contact:

How do I create a small popup (hovering) journal for my players?

#1 Post by olddog » Tue Mar 30, 2021 1:31 pm

I've looked around at the screens and screen language section and I'm just miserably failing here.

I'd like to create a simple journal/to-do list popup that appears somewhere in the middle of the screen when the user clicks a journal button on the main screen.

It'd just be a basic bordered window with lines of text that can scroll. Items are just text like "Jan is waiting for you at the bar" and so forth to help guide the player.

Just a simple gray bordered box with multiple text lines that can scroll and a "Close" button (bonus if it can be closed by clicking the main screen behind the box.

User avatar
laure44
Regular
Posts: 60
Joined: Mon Mar 08, 2021 10:55 pm
Projects: Arkan'sTower, Gemshine Lorelei!
Location: France
Contact:

Re: How do I create a small popup (hovering) journal for my players?

#2 Post by laure44 » Tue Mar 30, 2021 1:57 pm

Hey there,

Code: Select all

screen journal_screen:
    
    modal True
        
    imagebutton idle Solid((0,0,0,0.0)) action Hide("journal_screen") # If you click outside of the box, it will hide the screen
    
    frame: # simulates a border, there are probably better ways to do that though
        modal True
        background Frame(Solid("#aaa"), 10, 10)
        xsize 420 ysize 520
        xalign 0.5 yalign 0.5
        
        frame:
            background Frame(Solid("#fff"), 10, 10)
            xsize 400 ysize 500
            xalign 0.5 yalign 0.5 # centered
            
            viewport id "journal_viewport":
                xsize 350 ysize 400
                xalign 0.5 yalign 0.1
                draggable True mousewheel True
                
                vbox:
                    text "item 1" color "#000"
                    text "item 2" color "#000"
                    text "item 3" color "#000"
                    
            vbar value YScrollValue("journal_viewport") xalign 1.0
            textbutton "Close" action Hide("journal_screen") xalign 0.5 yalign 1.0
The imagebutton to show the screen :

Code: Select all

    imagebutton idle "gui/journal.png" action Show("journal_screen")
You can place that whereever you want :)

olddog
Newbie
Posts: 18
Joined: Sun Dec 30, 2018 11:27 am
Projects: Kismet, a TF/TG game
Contact:

Re: How do I create a small popup (hovering) journal for my players?

#3 Post by olddog » Tue Mar 30, 2021 2:44 pm

Absolutely perfect, thank you so much! It's exactly what I needed - super basic but enough to get me going and also give me something to build off of.

Wow - again, thank you!

Post Reply

Who is online

Users browsing this forum: Alex, Google [Bot], nyeowmi