Textbox exceeding screen limit?

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
Nanahs
Veteran
Posts: 297
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

Textbox exceeding screen limit?

#1 Post by Nanahs » Sat Feb 16, 2019 6:25 pm

My project is 720x1280.

In a screen like:

Code: Select all

screen day1:
    
    text "[imput text]." size 25 xpos 30 ypos 1105 
The text is exceeding the screen limit (horizontal).
Is there a way I can put a limit, so that the text won't do this?

This screen is showing an imput text a let the player write.

Thanks.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 2981
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Textbox exceeding screen limit?

#2 Post by Imperf3kt » Sat Feb 16, 2019 11:02 pm

One way would be to place the input in a container and give the container an xmaximum
A "fixed" or "hbox" or "vbox" etc should work

Something like this

Code: Select all

screen day1():
    fixed:
        xmaximum 500

        text "[input text]." size 25 xpos 30 ypos 1105
This would limit the text width to 500 pixels. If the text exceeds this limit, it will split onto a new line.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Free Android GUI - Updated occasionally

User avatar
Nanahs
Veteran
Posts: 297
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

Re: Textbox exceeding screen limit?

#3 Post by Nanahs » Thu Feb 21, 2019 7:58 pm

Imperf3kt wrote:
Sat Feb 16, 2019 11:02 pm
One way would be to place the input in a container and give the container an xmaximum
A "fixed" or "hbox" or "vbox" etc should work

Something like this

Code: Select all

screen day1():
    fixed:
        xmaximum 500

        text "[input text]." size 25 xpos 30 ypos 1105
This would limit the text width to 500 pixels. If the text exceeds this limit, it will split onto a new line.
It worked. Thank you!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], deadhand, newbiemate, Shocking Alberto