Notify screen question : how to notify more than once

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
Doogy
Newbie
Posts: 16
Joined: Wed Aug 19, 2009 9:52 am
Location: Rennes [France]
Contact:

Notify screen question : how to notify more than once

#1 Post by Doogy »

Hi,
I am searching for a way to display more than one notify screen at the same time, like a stack of notify.
Does anyone have an idea how to do that ?
Sorry for my english, i am french.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Notify screen question : how to notify more than once

#2 Post by PyTom »

Sorry, but that's not really a function of the notify screen. It's mostly meant for Ren'Py, showing things like fact that a screenshot is created, one at a time.

If you want to change the behavior, you'll have to make your own screen.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
xavimat
Eileen-Class Veteran
Posts: 1460
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

Re: Notify screen question : how to notify more than once

#3 Post by xavimat »

Give this a try:

Code: Select all

default notices = []

label start:
    scene bg room
    show eileen happy
    
    $ notices.append("Hi! I'm a message!")
    $ notices.append("I'm a message too!")
    $ notices.append("Me too! Me too!")
    $ notices.append("Hey! This is kind of crowded!")
    $ notices.append("Give way! I'm an important message!")
    $ notify_me("Hey, don't push! We were here before!")
    
    "You've created a new Ren'Py game."
    
    $ notify_me("Phew... finally alone...")
    
    "Once you add a story, pictures, and music, you can release it to the world!"
    return

init python:

    def notify_me(m=""):
        global notices
        if m:
            notices.append(m)
        if notices:
            renpy.show_screen('notify_plus', notices=notices)
            notices = []

screen notify_plus(notices):

    zorder 100
    style_prefix "notify"

    for dd, i in enumerate(notices):
        frame at notify_plus_appear(dd*3.5):
            text i

    timer 4.25+(dd*3.5) action Hide('notify_plus')

transform notify_plus_appear(dd=0):
    on show:
        yoffset dd*7
        alpha 0 xanchor 1.0 xpos 0.0
        pause dd
        linear .25 alpha 1.0 xalign 0.0
        pause 3.25
        linear .5 alpha 0.0
Note that it doesn't adapts to new notices incoming in the middle of the stack, a new "notify_me()" function will overwrite the remaining stack and present the new one (as the current renpy.notify() does).
The stack is created with $ notices.append("Message"), but it's only shown when the function $notify_me("Message") is called. It passes the stack to the screen and empties it for new messages.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

Post Reply

Who is online

Users browsing this forum: Google [Bot]