How/where is the say window textbox positioned? [Solved]
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.
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.
- fluxus
- Regular
- Posts: 133
- Joined: Thu Jun 19, 2014 8:06 am
- Projects: Animal Anaesthesia (a teaching game)
- Contact:
How/where is the say window textbox positioned? [Solved]
Hello,
I have some trouble figuring out how to position the text box for dialogue anywhere else than at the bottom of the screen.
It could probably be done from options.rpy, but since it isn't, I assume it's done through either styles or themes.
And the question is if I need to take other things into account. I might be able to figure that part out by looking at the code and settings nearby.
If someone can point me to where :]
Example:
Let's say I want all dialogue to take place at the top of the screen instead of at the bottom. Where do I define this?
(And, yes, that'd be clunky, but with some almost-a-speech-bubble customization it could be useful)
I have some trouble figuring out how to position the text box for dialogue anywhere else than at the bottom of the screen.
It could probably be done from options.rpy, but since it isn't, I assume it's done through either styles or themes.
And the question is if I need to take other things into account. I might be able to figure that part out by looking at the code and settings nearby.
If someone can point me to where :]
Example:
Let's say I want all dialogue to take place at the top of the screen instead of at the bottom. Where do I define this?
(And, yes, that'd be clunky, but with some almost-a-speech-bubble customization it could be useful)
Last edited by fluxus on Tue Jun 24, 2014 5:06 am, edited 1 time in total.
-
- Regular
- Posts: 179
- Joined: Wed Mar 13, 2013 9:55 pm
- Completed: MazeSite01, Ponderings of Time
- Contact:
Re: How/where is the say window textbox positioned?
You need to define the xpos (x position) and ypos (y position), in pixels, of your textbox in the Options script file.
Code: Select all
#########################################
## These settings let you customize the window ...blah blah, etc.
## add in these style statements:
style.window.xpos = 400 #this is what the values would be if you wanted the text box to be on the top
style.window.ypos = 150
- OokamiKasumi
- Eileen-Class Veteran
- Posts: 1779
- Joined: Thu Oct 14, 2010 3:53 am
- Completed: 14 games released -- and Counting.
- Organization: DarkErotica Games
- Deviantart: OokamiKasumi
- Location: NC, USA
- Contact:
Re: How/where is the say window textbox positioned?
Um...mjshi wrote:You need to define the xpos (x position) and ypos (y position), in pixels, of your textbox in the Options script file.
Code: Select all
######################################### ## These settings let you customize the window ...blah blah, etc. ## add in these style statements: style.window.xpos = 400 #this is what the values would be if you wanted the text box to be on the top style.window.ypos = 150
xpos is across or side to side. <->
ypos is up-down. ^v
What this code does is make the box 400px to the right, and 150px up from the bottom.
The only way I've discovered to lift the textbox from the bottom is by adding to the bottom_margin.
Code: Select all
style.say_window.bottom_margin = 500
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
-
- Regular
- Posts: 179
- Joined: Wed Mar 13, 2013 9:55 pm
- Completed: MazeSite01, Ponderings of Time
- Contact:
Re: How/where is the say window textbox positioned?
Seriously? I actually tested these and it worked for me ._.
You can actually move them around too...
see, if you had in the code
it would move over to the right a few pixels:
You can actually move them around too...
see, if you had in the code
Code: Select all
style.window.xpos = 500
style.window.ypos = 150
- OokamiKasumi
- Eileen-Class Veteran
- Posts: 1779
- Joined: Thu Oct 14, 2010 3:53 am
- Completed: 14 games released -- and Counting.
- Organization: DarkErotica Games
- Deviantart: OokamiKasumi
- Location: NC, USA
- Contact:
Re: How/where is the say window textbox positioned?
Oddly, this does indeed work in an 800x600game. However, when I use it in a 1366x768 game, it only works when there's no dialogue.mjshi wrote:Seriously? I actually tested these and it worked for me ._.
You can actually move them around too...
see, if you had in the codeit would move over to the right a few pixels:Code: Select all
style.window.xpos = 500 style.window.ypos = 150
No dialogue, using 'window show': However when there is dialogue the textbox pops back down to the bottom. My textbox code.
-- I removed all the margins just to be sure.
Code: Select all
##-------------- Textbox ----------------------
init -2:
style window:
## Frame ------------------------
background Frame("ui/textbox.png", 0, 0)
xpos 683
ypos 150
## No Frame --------------------
# background "ui/textbox.png"
## Margin is space surrounding the window, where the background
## is not drawn.
# left_margin 100
# right_margin 100
# top_margin 0
# bottom_margin 560
## Padding is space inside the window, where the background is
## drawn.
left_padding 260
right_padding 290
top_padding 25
bottom_padding 25
## This is the minimum height of the window, including the margins
## and padding.
# xminimum 500
# yminimum 235
Code: Select all
define a = Character(None,
what_prefix="\"",
what_suffix="\"",
show_two_window = True,
show_side_image=Image("ch/ArchieS.png", xalign=0.10, yalign=0.0),
ctc="ctc_blink",
ctc_position="fixed",
)
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
-
- Regular
- Posts: 179
- Joined: Wed Mar 13, 2013 9:55 pm
- Completed: MazeSite01, Ponderings of Time
- Contact:
Re: How/where is the say window textbox positioned?
I must say, that's a very vintage-looking test project xD
Anyway, here's a window sized 400x400, with xpos at 200, ypos at 150:
Here's a window sized 1000x700, with xpos at 500, ypos at 150:
It still works with a clean, untouched script, maybe it's the other cookbook scripts you've added on forcing it back there? I have no idea.
Also, I've noticed an interesting correlation- if the window is at the top, ypos is 150; and the xpos is whatever the window x value is, divided by two. (see, 400x400, xpos 200. 1000x700, xpos 500. 800x600, xpos 400, etc etc)
Anyway, here's a window sized 400x400, with xpos at 200, ypos at 150:
Here's a window sized 1000x700, with xpos at 500, ypos at 150:
It still works with a clean, untouched script, maybe it's the other cookbook scripts you've added on forcing it back there? I have no idea.
Also, I've noticed an interesting correlation- if the window is at the top, ypos is 150; and the xpos is whatever the window x value is, divided by two. (see, 400x400, xpos 200. 1000x700, xpos 500. 800x600, xpos 400, etc etc)
- OokamiKasumi
- Eileen-Class Veteran
- Posts: 1779
- Joined: Thu Oct 14, 2010 3:53 am
- Completed: 14 games released -- and Counting.
- Organization: DarkErotica Games
- Deviantart: OokamiKasumi
- Location: NC, USA
- Contact:
Re: How/where is the say window textbox positioned?
Thank you!mjshi wrote:I must say, that's a very vintage-looking test project xD
-- I was playing around with some Public Domain Regency era illustrations.
It's possible, I guess?mjshi wrote:It still works with a clean, untouched script, maybe it's the other cookbook scripts you've added on forcing it back there? I have no idea.
Yep, I spotted that. It's how I got the box at the top, even if it's only without text. It's possible that the image is being set so far over (x) it pops out the top?mjshi wrote:Also, I've noticed an interesting correlation- if the window is at the top, ypos is 150; and the xpos is whatever the window x value is, divided by two. (see, 400x400, xpos 200. 1000x700, xpos 500. 800x600, xpos 400, etc etc)
Anyway, I guess I'll just have to stick with using a high bottom margin for this one.
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
- fluxus
- Regular
- Posts: 133
- Joined: Thu Jun 19, 2014 8:06 am
- Projects: Animal Anaesthesia (a teaching game)
- Contact:
Re: How/where is the say window textbox positioned?
Hello!
This is your intrepid asker reporting back.
options.rpy:
seems to do the trick, although I still have a so far unexplained discolouring of the background image where the textbox is normally positioned. But that might be an effect of me messing with other things.
Using a custom narrator-character and custom-styling *that* window is probably the safer option to choose, but not being able to manipulate such a central part of the interface bothered me to no end.
I'd probably have found this out sooner if I'd read your answers more carefully; I've mostly been messing with screens.rpy thinking that the textbox is a screen. So it must be configured there, right? No.. :]
Quite nicely explained though. Thank you.
Is there a reason in particular for using ypos instead of yalign? Admittedly I haven't tested rigorously :]
The coordinate numbers might have something to do with the way ren'py wants to match up x/yanchor and x/ypos, but I'm not sure. It's different to how I'm used to thinking of things, but seems to work well for supporting the x/yalign statements.
This is your intrepid asker reporting back.
options.rpy:
Code: Select all
style.window.yalign = 0.0
Using a custom narrator-character and custom-styling *that* window is probably the safer option to choose, but not being able to manipulate such a central part of the interface bothered me to no end.
I'd probably have found this out sooner if I'd read your answers more carefully; I've mostly been messing with screens.rpy thinking that the textbox is a screen. So it must be configured there, right? No.. :]
Quite nicely explained though. Thank you.
Is there a reason in particular for using ypos instead of yalign? Admittedly I haven't tested rigorously :]
The coordinate numbers might have something to do with the way ren'py wants to match up x/yanchor and x/ypos, but I'm not sure. It's different to how I'm used to thinking of things, but seems to work well for supporting the x/yalign statements.
- fluxus
- Regular
- Posts: 133
- Joined: Thu Jun 19, 2014 8:06 am
- Projects: Animal Anaesthesia (a teaching game)
- Contact:
Re: How/where is the say window textbox positioned?
Back with news of the discolouring:
It was seemingly caused by scaling the previous background image to 800x600.
At least, changing to an image which was already scaled fixed the issue.
It was seemingly caused by scaling the previous background image to 800x600.
At least, changing to an image which was already scaled fixed the issue.
-
- Regular
- Posts: 179
- Joined: Wed Mar 13, 2013 9:55 pm
- Completed: MazeSite01, Ponderings of Time
- Contact:
Re: How/where is the say window textbox positioned? [Solved]
No particular reason, but that was the way I learned it xD
I think you can use the two of them interexchangably, yalign would just be fractions while ypos is a definite pixel value (namely, the height of your textbox if you wanted it at the top)
I think you can use the two of them interexchangably, yalign would just be fractions while ypos is a definite pixel value (namely, the height of your textbox if you wanted it at the top)
- fluxus
- Regular
- Posts: 133
- Joined: Thu Jun 19, 2014 8:06 am
- Projects: Animal Anaesthesia (a teaching game)
- Contact:
Re: How/where is the say window textbox positioned? [Solved]
@mjshi: Ok, I'll continue my fractional ways then.. thanks!
Who is online
Users browsing this forum: Majestic-12 [Bot], piinkpuddiin, snotwurm