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.
-
Kinmoku
- Miko-Class Veteran
- Posts: 560
- Joined: Mon Aug 11, 2014 9:39 am
- Completed: One Night Stand
- Projects: Love IRL, Memories
- Tumblr: gamesbykinmoku
- itch: kinmoku
- Location: Germany
-
Contact:
#1
Post
by Kinmoku » Mon Jul 12, 2021 3:48 am
Hi all,
I'm stress-testing my game and noticed that, if the player inputs a very long one word into the input prompt, it overflows out of the box (see image). However, the input works as desired when typical text (with spaces) is written, going to multiple lines and fitting within the box.
This is kind of a non issue, but no doubt some player will spot it and think it's messy. Is there a way to get the input text to wrap (even if it's one long word)?
My code:
Code: Select all
frame:
background None
xpos 582
ypos 442
xmaximum 760
ymaximum 160
input id "quote" default "" caret theme_image("caret") changed quote_change length 80 exclude "{}" color get_primary() xmaximum 760 ymaximum 160
-
Ocelot
- Eileen-Class Veteran
- Posts: 1883
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
-
Contact:
#2
Post
by Ocelot » Mon Jul 12, 2021 4:10 am
I don't think RenPy has support for individual word wrap.
You could detect long words in changed function and insert zero-width space symbol to break it up.
< < insert Rick Cook quote here > >
-
Kinmoku
- Miko-Class Veteran
- Posts: 560
- Joined: Mon Aug 11, 2014 9:39 am
- Completed: One Night Stand
- Projects: Love IRL, Memories
- Tumblr: gamesbykinmoku
- itch: kinmoku
- Location: Germany
-
Contact:
#3
Post
by Kinmoku » Mon Jul 12, 2021 9:57 am
Ocelot wrote: ↑Mon Jul 12, 2021 4:10 am
I don't think RenPy has support for individual word wrap.
Ah, that makes sense.
Ocelot wrote: ↑Mon Jul 12, 2021 4:10 am
You could detect long words in
changed function and insert zero-width space symbol to break it up.
I'm not quite sure what you mean.
-
Ocelot
- Eileen-Class Veteran
- Posts: 1883
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
-
Contact:
#4
Post
by Ocelot » Mon Jul 12, 2021 10:06 am
Zero-width space is a special character that is treated as space and logically separate words for word-wrap, but does not have a width, previous and next letters would be displayed together without any gap. Every word of my message is written with that character between each letter. This is why words are breaking in strange places.
You can detect ling words and break them apart with this character to allow word-wrap to apply to them.
< < insert Rick Cook quote here > >
Users browsing this forum: Bing [Bot], Google [Bot], _ticlock_