[SOLVED] Say window ATL and side images

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.
Message
Author
User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: Say window ATL and side images

#16 Post by indoneko »

Are you going to use two window and/or character names in later part of your game?
If not, we might as well remove those block from the say screen.
My avatar is courtesy of Mellanthe

famakki1
Regular
Posts: 55
Joined: Wed Oct 12, 2016 7:40 am
Contact:

Re: Say window ATL and side images

#17 Post by famakki1 »

I do intend to use the two window format as well...if removing the two window will end up fixing this issue I am willing to give it a shot though ! But best case is that include two window, I'm willing to let go of side images in two window because the Character name will be shown so the reader will know who is who. For one window, I obviously need the side image.

User avatar
Saltome
Veteran
Posts: 244
Joined: Sun Oct 26, 2014 1:07 pm
Deviantart: saltome
Contact:

Re: Say window ATL and side images

#18 Post by Saltome »

If you ask me you should just go with my original snippet. It wasn't ideal, but at least it didn't bug out. I think it's an okay compromise.
Deviant Art: Image
Discord: saltome
Itch: Phoenix Start

famakki1
Regular
Posts: 55
Joined: Wed Oct 12, 2016 7:40 am
Contact:

Re: Say window ATL and side images

#19 Post by famakki1 »

Hi Saltome,

I have no problem with using your code, however, I attached a demo showing the issue with that code... The text does not fit in the required area and the dialogue box is not anchored. If that can be fixed then this it fine.

Is there no way to change the dialogue box zorder? I think if we can freely change zorder this issue will become a lot more simple

User avatar
Saltome
Veteran
Posts: 244
Joined: Sun Oct 26, 2014 1:07 pm
Deviantart: saltome
Contact:

Re: Say window ATL and side images

#20 Post by Saltome »

I was talking about the code before. The one showing the side image underneath the background.
And matter-of-factly, you can simply make the side image semi-transparent, to allow text to be visible through.

As far as zorder, that's only applied to screens. But even if you were able to figure out a way to change it, you need to be cautious of the consequences. Changing the zorder of screens means they won't have the zorder that is expected, and it can easily lead to graphical bugs where different screens overlap in weird ways.
Deviant Art: Image
Discord: saltome
Itch: Phoenix Start

User avatar
Saltome
Veteran
Posts: 244
Joined: Sun Oct 26, 2014 1:07 pm
Deviantart: saltome
Contact:

Re: Say window ATL and side images

#21 Post by Saltome »

*facepalm* The problem was happening because the side image was inside the window, that was bugging it out. With a little fiddling I seem to have tricked it.

Code: Select all

screen say(who, what, side_image=None, two_window=False):
    if side_image:
        window:
            id "window"
            null
            #has vbox:
                #style "say_vbox"
        add side_image
    else:
        if not two_window:
            window:
                id "window"
                null
                #has vbox:
                #style "say_vbox"
            add SideImage() xalign 0.0 yalign 1.0 
        else:
            window:
                id "window"
                null
            add SideImage() xalign 0.0 yalign 1.0 

    # Decide if we want to use the one-window or two-window variant.
    if not two_window:

        # The one window variant.
#        window:
#            id "window"

            vbox:
                ypos 576 #yalign 0.8
                style "say_vbox"

                if who:
                    ypos 612 #yalign 0.85
                    text who id "who" xpos 256 xmaximum 800

                text what id "what" xpos 256 xmaximum 800

    else:

        # The two window variant.
        vbox:
            ypos 562 #yalign 0.78
            style "say_two_window_vbox"

            if who:
                window:
                    style "say_who_window"

                    text who:
                        id "who" xpos 256 xmaximum 800

#            window:
#                id "window"
            null height 6
            vbox:
                style "say_vbox"

            text what id "what" xpos 256 xmaximum 800

    # If there's a side image, display it above the text.
    

    # Use the quick menu.
    use quick_menu
Deviant Art: Image
Discord: saltome
Itch: Phoenix Start

famakki1
Regular
Posts: 55
Joined: Wed Oct 12, 2016 7:40 am
Contact:

Re: Say window ATL and side images

#22 Post by famakki1 »

Hi Saltome,

Wow you did it! Yes I can confirm it works perfectly. I had to adjust the xpos/ypos values but otherwise this is some solid stuff!
Thanks a lot.

Although the main topic of this post got lost in time, I'll leave that for another time :)

I'll mark it as solved.

Thanks a lot Saltome.

User avatar
Saltome
Veteran
Posts: 244
Joined: Sun Oct 26, 2014 1:07 pm
Deviantart: saltome
Contact:

Re: [SOLVED] Say window ATL and side images

#23 Post by Saltome »

And about your other problem...
As per the example of this thread:
viewtopic.php?f=8&t=43083

Code: Select all

transform anim:
    on show:
        linear 0 yoffset 0
        linear 0.1 yoffset 10
        linear 0.1 yoffset 0
        linear 0.1 yoffset -10
        linear 0.1 yoffset 0
        repeat(3)

Code: Select all

screen say(who, what, side_image=None, two_window=False):
    if side_image:
        window:
            id "window"
            null
            at anim
            #has vbox:
                #style "say_vbox"
        add side_image
    else:
        if not two_window:
            window:
                id "window"
                null
                at anim
                #has vbox:
                #style "say_vbox"
            add SideImage() xalign 0.0 yalign 1.0 at anim
        else:
            window:
                id "window"
                null
                at anim
            add SideImage() xalign 0.0 yalign 1.0 at anim

    # Decide if we want to use the one-window or two-window variant.
    if not two_window:

        # The one window variant.
#        window:
#            id "window"

            vbox:
                ypos 576 #yalign 0.8
                style "say_vbox"
                at anim

                if who:
                    ypos 612 #yalign 0.85
                    text who id "who" xpos 256 xmaximum 800 at anim

                text what id "what" xpos 256 xmaximum 800 at anim

    else:

        # The two window variant.
        vbox:
            ypos 562 #yalign 0.78
            style "say_two_window_vbox"

            if who:
                window:
                    style "say_who_window"
                    at anim

                    text who:
                        id "who" xpos 256 xmaximum 800

#            window:
#                id "window"
            null height 6
            vbox:
                style "say_vbox"
            at anim
            text what id "what" xpos 256 xmaximum 800

    # If there's a side image, display it above the text.
    

    # Use the quick menu.
    use quick_menu
By the way did we really need to go through all this?
If your side image is never overlapping with the text, it doesn't make a difference if it's drawn before it or after it.
Deviant Art: Image
Discord: saltome
Itch: Phoenix Start

famakki1
Regular
Posts: 55
Joined: Wed Oct 12, 2016 7:40 am
Contact:

Re: [SOLVED] Say window ATL and side images

#24 Post by famakki1 »

Hi Saltome,

Ill give that transform a shot (I didn't try since I thought it might trigger everytime I use window show)

Regarding side images, actually the side images do overlap for me since I use slightly larger sized than in the demo, therefore I guess it was needed :p

Plus anyone else who wants to do the same now has a resource.

On a side note, loads of visual novels from Japan that I have played do make the text appear over the side images, so I thought it was a basic feature for Ren'Py... how wrong I was :p

Post Reply

Who is online

Users browsing this forum: No registered users