text centered in the middle of the bottom part of the screen(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
glithch
Regular
Posts: 93
Joined: Sat Jul 23, 2016 5:32 am
Contact:

text centered in the middle of the bottom part of the screen(solved)

#1 Post by glithch » Thu Dec 12, 2019 4:12 pm

this might seem really easy and simple but i havent touched renpy in a long time and documentation isnt helping me so i thought i would ask here.

neither
define gui.dialogue_text_xalign = 0.5
nor
define gui.dialogue_xpos = 600

really center it proprely.
i need the text to format appropriately. not just "start' at the beginning. but that it fills the appropriate space in the middle
Last edited by glithch on Tue Jan 14, 2020 6:34 pm, edited 2 times in total.

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

Re: text centered in the middle of the bottom part of the screen

#2 Post by Imperf3kt » Thu Dec 12, 2019 5:33 pm

Are you trying to make the text "justified"?
Use an xalign and additionally add an xfill True
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Twitter

glithch
Regular
Posts: 93
Joined: Sat Jul 23, 2016 5:32 am
Contact:

Re: text centered in the middle of the bottom part of the screen

#3 Post by glithch » Mon Dec 23, 2019 9:37 am

Imperf3kt wrote:
Thu Dec 12, 2019 5:33 pm
Are you trying to make the text "justified"?
Use an xalign and additionally add an xfill True
@Imperf3kt
i know this is a late answer, i was doing focused on the art' but where exactly do i add that xfill?

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

Re: text centered in the middle of the bottom part of the screen

#4 Post by Imperf3kt » Mon Dec 23, 2019 3:52 pm

Which text are you talking about.
When I suggested an xfill before, I forgot to ask.

Do you mean the dialogue text?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Twitter

glithch
Regular
Posts: 93
Joined: Sat Jul 23, 2016 5:32 am
Contact:

Re: text centered in the middle of the bottom part of the screen

#5 Post by glithch » Sat Jan 04, 2020 12:24 pm

Imperf3kt wrote:
Mon Dec 23, 2019 3:52 pm
Which text are you talking about.
When I suggested an xfill before, I forgot to ask.

Do you mean the dialogue text?
yes!
edit: i tried using justify True in style say_dialogue but it wont work

glithch
Regular
Posts: 93
Joined: Sat Jul 23, 2016 5:32 am
Contact:

Re: text centered in the middle of the bottom part of the screen(still need help)

#6 Post by glithch » Fri Jan 10, 2020 5:20 pm

is it ok if i bump this after some time?

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

Re: text centered in the middle of the bottom part of the screen(still need help)

#7 Post by Imperf3kt » Fri Jan 10, 2020 7:12 pm

Bumps are fine most of the time.
I forgot to reply and currently I am away from my laptop.

I would suggest looking for things related to the text box in gui.rpy, but I can't currently suggest what as I don't have access to any copy of renpy at the moment.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Twitter

User avatar
gas
Miko-Class Veteran
Posts: 620
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: text centered in the middle of the bottom part of the screen(still need help)

#8 Post by gas » Fri Jan 10, 2020 8:58 pm

The defaults are:

Code: Select all

define gui.dialogue_xpos = 268
define gui.dialogue_ypos = 50

## The maximum width of dialogue text, in pixels.
define gui.dialogue_width = 744

## The horizontal alignment of the dialogue text. This can be 0.0 for left-
## aligned, 0.5 for centered, and 1.0 for right-aligned.
define gui.dialogue_text_xalign = 0.0
You have 268 pixels of left margin by the dialogue frame pushed that side. Set it to 0.
You should also probably change the width of the dialogue frame from 744 to your window size.
then set dialogue_text_align to 0.5.
10 ? "RENPY"
20 GOTO 10

RUN

glithch
Regular
Posts: 93
Joined: Sat Jul 23, 2016 5:32 am
Contact:

Re: text centered in the middle of the bottom part of the screen(still need help)

#9 Post by glithch » Mon Jan 13, 2020 5:32 pm

gas wrote:
Fri Jan 10, 2020 8:58 pm
You have 268 pixels of left margin by the dialogue frame pushed that side. Set it to 0.
You should also probably change the width of the dialogue frame from 744 to your window size.
then set dialogue_text_align to 0.5.
this just pushes my text to the left, to the point where most of the message gets cut off.
Imperf3kt wrote:
Fri Jan 10, 2020 7:12 pm
Bumps are fine most of the time.
I forgot to reply and currently I am away from my laptop.

I would suggest looking for things related to the text box in gui.rpy, but I can't currently suggest what as I don't have access to any copy of renpy at the moment.
i did that multiple times and tried a lot of different things but still cant figure it out

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

Re: text centered in the middle of the bottom part of the screen(still need help)

#10 Post by Imperf3kt » Mon Jan 13, 2020 7:01 pm

Can you show a mock screenshot of what you want and a screenshot if what you currently have along with the relevant code you have right now?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Twitter

glithch
Regular
Posts: 93
Joined: Sat Jul 23, 2016 5:32 am
Contact:

Re: text centered in the middle of the bottom part of the screen(still need help)

#11 Post by glithch » Tue Jan 14, 2020 9:10 am

Imperf3kt wrote:
Mon Jan 13, 2020 7:01 pm
Can you show a mock screenshot of what you want and a screenshot if what you currently have along with the relevant code you have right now?
sorry for how messy it looks, just stitched it fast, ignore the clock.
https://imgur.com/a/MpOe6In
i dont know what code would i have to post, other then just changing the textbox size etc i didnt really touch anything.

User avatar
gas
Miko-Class Veteran
Posts: 620
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: text centered in the middle of the bottom part of the screen(still need help)

#12 Post by gas » Tue Jan 14, 2020 12:09 pm

Are these normal dialogue lines? They look as menu voices. Or just "text". Or whatever.

Anyway:

Code: Select all

define gui.dialogue_xpos = 0.5
define gui.dialogue_text_xalign = 0.5
That's the example in the gui doc, and it worked for me.
Did you try to erase permanent data too from the launcher?
10 ? "RENPY"
20 GOTO 10

RUN

glithch
Regular
Posts: 93
Joined: Sat Jul 23, 2016 5:32 am
Contact:

Re: text centered in the middle of the bottom part of the screen(still need help)

#13 Post by glithch » Tue Jan 14, 2020 6:34 pm

gas wrote:
Tue Jan 14, 2020 12:09 pm
Are these normal dialogue lines? They look as menu voices. Or just "text". Or whatever.

Anyway:

Code: Select all

define gui.dialogue_xpos = 0.5
define gui.dialogue_text_xalign = 0.5
That's the example in the gui doc, and it worked for me.
Did you try to erase permanent data too from the launcher?
omg finally that worked. i had no idea you could put decimals in xpos! it was a regular number so i assumed i cant just switch it to a decimal

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

Re: text centered in the middle of the bottom part of the screen(solved)

#14 Post by Imperf3kt » Tue Jan 14, 2020 8:27 pm

There's two forms of numbering, when you use whole numbers, it changes the position based on the number of pixels.
If you use a decimal, it's a percentage, with a range of 0.0 to 1.0, 1.0 being 100%, 0.5 being 50%, 0.0 being 0%, etc.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Twitter

Post Reply

Who is online

Users browsing this forum: Bing [Bot], CmdrMichael, Google [Bot]