Notify (2,3,4?)

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
Nikel
Regular
Posts: 29
Joined: Wed Dec 27, 2017 10:45 am
Contact:

Notify (2,3,4?)

#1 Post by Nikel »

Hello! Thx for attention. I have a question.
May I use several Notify screens?

Code: Select all

screen button:
        imagebutton:
            hovered Notify("Wait")
            idle "Buttons/waitidle.png"
            hover "Buttons/waithover.png"
            action Function (updateTime)
            xalign 0.5 ypos 0.87 xpos 0.96
I use Notify for buttons. And for each button the coordinates for the notify are necessary.
I try copy my code for each but doesnt work

Code: Select all

screen notify(message):

    zorder 100
    style_prefix "notify"

    frame at notify_appear:
        text "[message!tq]"

    timer 2 action Hide('notify')


transform notify_appear:
    on show:
        alpha 0
        linear .25 alpha 1.0
    on hide:
        linear .5 alpha 0.0


style notify_frame is empty
style notify_text is gui_text

style notify_frame:
    xalign 0.5 ypos 0.82 xpos 0.97
    background None #Frame("gui/notify.png", gui.notify_frame_borders, tile=gui.frame_tile)
    padding gui.notify_frame_borders.padding

style notify_text:
    properties gui.text_properties("notify")
    color "#fff"
    size 40
    font "fonts/myfont.ttf"


Actually to me it isn't important will be it the notify or just the text. But "hovered" work only with "Notify" for me.
Any tips?
Sry for bad eng.

Nikel
Regular
Posts: 29
Joined: Wed Dec 27, 2017 10:45 am
Contact:

Re: Notify (2,3,4?)

#2 Post by Nikel »

ok... mb someone know how i can do this:

Code: Select all

hover ["Buttons/waithover.png", show text (or screen)]
I mean when button hovered , img change and show text.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Notify (2,3,4?)

#3 Post by Ocelot »

1) Create your own screen (you can just copy and rename notify...)
2) Create a Python function which will show your screen with parameters.
3) Use Function action in hovered property
< < insert Rick Cook quote here > >

Nikel
Regular
Posts: 29
Joined: Wed Dec 27, 2017 10:45 am
Contact:

Re: Notify (2,3,4?)

#4 Post by Nikel »

I try it.

Code: Select all

screen note(message):

    zorder 100
    style_prefix "note"

    frame at note_appear:
        text "[message!tq]"

    timer 2 action Hide('note')


transform note_appear:
    on show:
        alpha 0
        linear .25 alpha 1.0
    on hide:
        linear .5 alpha 0.0


style note_frame is empty
style note_text is gui_text

style notify_frame:
    xalign 0.5 ypos 0.82 xpos 0.97
    background None #Frame("gui/notify.png", gui.notify_frame_borders, tile=gui.frame_tile)

style note_text:
    properties gui.text_properties("note")
    color "#fff"
    size 40
    font "fonts/myfont.ttf"

Code: Select all

screen frbutton:
        imagebutton:
            xalign 0.5 ypos 0.01 xpos 0.14
            hovered  action note ("test")
            hover "Buttons/frbutton.png"
            idle "Buttons/frbutton1.png"
            action Jump("fr")
doesnt work.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Notify (2,3,4?)

#5 Post by Ocelot »

You missed points (2) and (3):

Code: Select all

def show_note(text):
    renpy.show_screen("note", message=text)

# . . .
hovered  Function(show_note, "test")
Actually, you can just use Show screen action instead:

Code: Select all

hovered  Show(note, message="test")
< < insert Rick Cook quote here > >

Nikel
Regular
Posts: 29
Joined: Wed Dec 27, 2017 10:45 am
Contact:

Re: Notify (2,3,4?)

#6 Post by Nikel »

Thx. Its work.

Nikel
Regular
Posts: 29
Joined: Wed Dec 27, 2017 10:45 am
Contact:

Re: Notify (2,3,4?)

#7 Post by Nikel »

I need lear python more)

Post Reply

Who is online

Users browsing this forum: Bing [Bot]