help with padding in say and text width

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
felsenstern
Regular
Posts: 72
Joined: Tue Jul 11, 2017 2:13 am
Contact:

help with padding in say and text width

#1 Post by felsenstern »

Heya,

Once again, I hit a rock.

In the Character objects which contain a side image, I also define a padding like window_left_padding=140. Unfortunately this causes my text area to move 140 pixel to the right instead of just add a padding and I wondered, how I can do something like a style change inside of the say screen to do something like size-window_left_padding for the text what id "what" line. But I seem to be too stupid to understand how the styles are applied there, since who and what are only containing the name and the speech text, no idea how the other information from the Character object are retrieved in here and while I searched in the the documentation, I couldn't find anything to help me further.
---
Yes, I've Read The F*cking Manual
Yes, I've used the f*cking search function
Yes, I've used a site search
No, I don't need a reminder that search functions exist
No, I don't need your astonished outbreak that I couldn't find the information
No, I don't need your answer if you can't just give it without all the BS around it

User avatar
m_from_space
Miko-Class Veteran
Posts: 975
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: help with padding in say and text width

#2 Post by m_from_space »

felsenstern wrote: Wed Jan 03, 2024 6:17 am But I seem to be too stupid to understand how the styles are applied there, since who and what are only containing the name and the speech text, no idea how the other information from the Character object are retrieved in here and while I searched in the the documentation, I couldn't find anything to help me further.
When it comes to the dialogue window, styles are applied according to the "window" styles that are defined inside <screens.rpy>. That is also where the say() screen is located. You have to change styles and the screen in there to make your wishes come true.

felsenstern
Regular
Posts: 72
Joined: Tue Jul 11, 2017 2:13 am
Contact:

Re: help with padding in say and text width

#3 Post by felsenstern »

Ok, sorry my bad, I try to explain it a bit better where my problem lies.

I am using window_left_padding=140 in my Character

image side bob ="BobBust.png"
define bob = Character("Bob the builder", image="bob", window_left_padding=140)

that should make space in the textbox so the side image will not cover text

but window_left_padding is not padding the text, it is moving the text to the side, so the text has the same width as before, just moved 140 pixel to the right and out of my window.

now I want to find a way to automatically reduce the text width (xsize), by the padding value.

to do that, I want to retrieve the padding value in the say screen so that I can reduce the text size with something like:

text what id "what" xsize gui.dialogue_width-character.window_left_padding

unfortunately I didn't find a clean way to get either the character object or the padding value inside the say screen.
---
Yes, I've Read The F*cking Manual
Yes, I've used the f*cking search function
Yes, I've used a site search
No, I don't need a reminder that search functions exist
No, I don't need your astonished outbreak that I couldn't find the information
No, I don't need your answer if you can't just give it without all the BS around it

Post Reply

Who is online

Users browsing this forum: No registered users