Side Images and Resizing Text/Dialogue Box - (SOLVED)

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
Gryphbear
Regular
Posts: 91
Joined: Wed Jun 16, 2010 11:45 pm
Contact:

Side Images and Resizing Text/Dialogue Box - (SOLVED)

#1 Post by Gryphbear »

Hello - I've been trying to figure out how to resize the text dialogue box whenever I show a side image - because I don't want to have the window be permanently one size or the other. I know it can be done, but I just have no idea how.

I've poked around in screens.rpy, and options.rpy. I can get the side image to show up where I want it, but.... it's stuck above the namebox.

I initially created it so the text box was always margin_left = 140 - but I don't want every text box to appear like that. I only want the full screen text box for descriptions and the narrator's speaking. I'm assuming it's some sort of conditional formatting somehow? Any help would be appreciated.

Edit: I've now coded it so that every time the 'character' speaks, their side-image will always show up, by defining the image inside the character's attributes. So that's not going to be a problem. Now I just need to figure out how to move/resize the textbox whenever a character with a side-image speaks to accommodate their image.

Final Edit:
I figured it out.

Putting margin 140, 0, 0, 0 in the 'screens.rpy' did the trick. Plus

Code: Select all

if who:
                window:
                    style "say_who_window" 
                    margin 140,0, 0, 0  # This should be left-padding, top, middle, right, etc Or you could do xmargin 140 (or however wide image is)
                    
                    text who:
                        id "who"
                   
            window:
                id "window"
                margin 140,0, 0, 0
                
                 # If there's a side image, display it above the text.
    if side_image:
        add side_image
      
    else:
        add SideImage() xalign 0.0 yalign 1.0  # Adding the x/y align coordinates helped align the image where it should be. 
 
So, I guess I solved it by myself, haha. I thought I'd add what I did to make sure others could do this as well.
Side Image Issues.png
Side Image Fixed.png
WIP: Ring av Guder - (Contemporary Fantasy VN/Dating Sim?)

What do you get when you inherit a mystical ring, meet Norse Dieties, and Werewolves, Satyrs, or Dwarves? Possibilities.

General Completion: 5% - (Still working on story plot.)
Story status: 1% (In progress of revamping)
Scripting: 1% (Prologue is about done)
Character Art: 0% (Would like to find a Bara-type Artist, but will learn to draw them myself if necessary)
BG/CG's: 0% (None so far)

Post Reply

Who is online

Users browsing this forum: No registered users