Page 1 of 1

Notify (2,3,4?)

Posted: Sun Jan 07, 2018 3:40 pm
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.

Re: Notify (2,3,4?)

Posted: Mon Jan 08, 2018 6:39 am
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.

Re: Notify (2,3,4?)

Posted: Mon Jan 08, 2018 6:48 am
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

Re: Notify (2,3,4?)

Posted: Mon Jan 08, 2018 7:38 am
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.

Re: Notify (2,3,4?)

Posted: Mon Jan 08, 2018 7:47 am
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")

Re: Notify (2,3,4?)

Posted: Mon Jan 08, 2018 7:55 am
by Nikel
Thx. Its work.

Re: Notify (2,3,4?)

Posted: Mon Jan 08, 2018 8:03 am
by Nikel
I need lear python more)