[SOLVED] Automatic scaling of dialogue box to the width of text?

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
TAEKO
Newbie
Posts: 21
Joined: Mon Jul 23, 2018 3:24 am
Contact:

[SOLVED] Automatic scaling of dialogue box to the width of text?

#1 Post by TAEKO » Mon Sep 24, 2018 7:25 am

I have been exploring the screens.rpy of a project then I kind of suddenly wondered if it is possible to have an automatic scaling dialog box that depends on the width of the text inside it, more like FE:Sacred Stones style.

Image Image
This is the kind of effect I was hoping to achieve ^

And for some reasons, the width only changes when I change the xmaximum...?

Code: Select all

style windowL:
    background Frame("dialogue_box_L", 27, 24,40,34)
    padding (0,0,0,34)
    xalign 0.0
    xoffset 350
    yoffset -120
    yalign 0.5
    xminimum 138
    xmaximum 450
    xsize None
    yminimum 20
    ymaximum 138
Last edited by TAEKO on Fri Oct 19, 2018 11:21 am, edited 1 time in total.
Don't read me...
Seriously don't.
Just kidding. I'm just an awkward potato who doesn't know what to say in my signature...

philat
Eileen-Class Veteran
Posts: 1733
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Automatic scaling of dialogue box to the width of text?

#2 Post by philat » Thu Sep 27, 2018 1:32 am

Delete xmaximum and xsize.

User avatar
TAEKO
Newbie
Posts: 21
Joined: Mon Jul 23, 2018 3:24 am
Contact:

Re: Automatic scaling of dialogue box to the width of text?

#3 Post by TAEKO » Sun Sep 30, 2018 10:34 am

philat wrote:
Thu Sep 27, 2018 1:32 am
Delete xmaximum and xsize.
It didn't seem to work... The window only stretched to the whole screen.
I'm comparing it to the code of the (self-resizing) namebox with no success :<
Don't read me...
Seriously don't.
Just kidding. I'm just an awkward potato who doesn't know what to say in my signature...

User avatar
kostek00
Regular
Posts: 127
Joined: Wed Mar 28, 2018 5:54 pm
Contact:

Re: Automatic scaling of dialogue box to the width of text?

#4 Post by kostek00 » Sun Sep 30, 2018 6:40 pm

Did you tried xfill an yfill with False? https://www.renpy.org/doc/html/style_pr ... erty-xfill

philat
Eileen-Class Veteran
Posts: 1733
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Automatic scaling of dialogue box to the width of text?

#5 Post by philat » Sun Sep 30, 2018 9:09 pm

I don't know where you're getting xfill from, but if it's stretching to the whole screen then I guess it's there somewhere. Set it to False.

User avatar
TAEKO
Newbie
Posts: 21
Joined: Mon Jul 23, 2018 3:24 am
Contact:

Re: Automatic scaling of dialogue box to the width of text?

#6 Post by TAEKO » Fri Oct 19, 2018 11:21 am

Update: This is fixed. I changed the id that's where things went wrong. I reverted it back to "window" and now it's all good. Marking as solved.
Don't read me...
Seriously don't.
Just kidding. I'm just an awkward potato who doesn't know what to say in my signature...

Post Reply

Who is online

Users browsing this forum: Google [Bot]