Namebox that is part of the textbox image
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.
Namebox that is part of the textbox image
MAybe this has been asked before, but I just didn't find it.
How should I go about positioning a name when the namebox is attached to the textbox instead of a separate image?
How should I go about positioning a name when the namebox is attached to the textbox instead of a separate image?
- 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: Namebox that is part of the textbox image
What I would do is use the Two Window option and use a fully transparent image for the Name box, then adjust the padding and margins to make the name fit where I need it to go.AERenoir wrote:...How should I go about positioning a name when the namebox is attached to the textbox instead of a separate image?
in Script.rpy:
Code: Select all
init:
define e = Character('Eileen',
color = "#c8ffc8",
show_two_window = True,
)
Code: Select all
###############################################
## ---------- Name Box ---------------------
style.say_label.font = "fo/LHFmisterkookyREG_0.TTF"
style.say_label.size =30
style.say_label.bold = False
style.say_label.outlines = [(1, "#330000", 0, 0)]
## ----- Frame (expandable) ------------------------
# style.say_who_window.background = Frame("ui/BlankWhoBox.png", 0, 0)
## ---- No Frame (Not expandable) ---------------
style.say_who_window.background = "ui/BlankWhoBox.png"
style.say_who_window.left_padding = 30
style.say_who_window.right_padding = 30
style.say_who_window.top_padding = 30
style.say_who_window.bottom_padding = 3
style.say_who_window.left_margin = 250
style.say_who_window.right_margin = 0
style.say_who_window.top_margin = 0
style.say_who_window.bottom_margin = 0
style.say_who_window.yminimum = 10
style.say_who_window.xminimum = 10
Last edited by OokamiKasumi on Thu Apr 03, 2014 12:47 pm, edited 1 time in total.
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
Re: Namebox that is part of the textbox image
I saw this recently: http://lemmasoft.renai.us/forums/viewto ... =8&t=21677
What does THIS do?
I'm also interested in the idea of having images as names, but I'm not understanding how the codes posted in the linked thread work. How do I call the person's name-image, again?
What does THIS do?
Code: Select all
$ style.say_who_window.background = None # To remove the say backgroundRe: Namebox that is part of the textbox image
There's only one problem with this method that I'm experiencing, and that's that the name that I'm putting in the 'attached text box' is being covered up by it. I have the text box set to 50% transparency, so I can still see the name, but I'd rather that the name appears in front of it. I'm also wondering how I can center each different name within the box. I'm sure there's some sort of code that's simple that I'm missing (I just started using ren'py a week ago or so but have been learning quickly so far) that can do this, but I'm not sure. Please help!!
- SinnyROM
- Regular
- Posts: 166
- Joined: Mon Jul 08, 2013 12:25 am
- Projects: Blue Birth
- Organization: Cosmic Static Games
- Contact:
Re: Namebox that is part of the textbox image
That line allows no background image to display behind the sayer's name. It's a transparent namebox in a way, as if the name of the sayer is floating by itself.AERenoir wrote:
In the link, they had individual image files for each sayer's name with the file name being identical to the character's name. The second post has their say screen in screen.rpy code following that convention, with all their image files in PNG format located in the game folder.
I had the same issue with the two-window variant and it was a matter of placing the who elements after the window/what elements.amimajime wrote:
Code: Select all
# The two window variant.
vbox:
style "say_two_window_vbox"
window:
id "window"
has vbox:
style "say_vbox"
text what id "what"
if who:
window:
style "say_who_window"
text who:
id "who"
Code: Select all
style.say_label.text_align = 0.5 #0.0 left-align, 0.5 centre, 1.0 right-align
Last edited by SinnyROM on Thu Apr 03, 2014 1:33 am, edited 1 time in total.
Re: Namebox that is part of the textbox image
That's great! I'm actually able to layer it on top of the dialogue window! I did some adjustments, and voila! It's in the box.
But actually… there's still one more problem. It's not in the box "all" the time.
Since the dialogue sometimes has 1,2, or 3 lines - the name gets moved down every time there's more than 1 line of dialogue. So at one point, it'll look fine. But then when there's a long dialogue (over 1 line of text) the name moves down and goes outside the box. How do we fix this?
(And I'm also going to try centering things too. I want to get this fixed first though : ) thank you!)
But actually… there's still one more problem. It's not in the box "all" the time.
Since the dialogue sometimes has 1,2, or 3 lines - the name gets moved down every time there's more than 1 line of dialogue. So at one point, it'll look fine. But then when there's a long dialogue (over 1 line of text) the name moves down and goes outside the box. How do we fix this?
(And I'm also going to try centering things too. I want to get this fixed first though : ) thank you!)
- SinnyROM
- Regular
- Posts: 166
- Joined: Mon Jul 08, 2013 12:25 am
- Projects: Blue Birth
- Organization: Cosmic Static Games
- Contact:
Re: Namebox that is part of the textbox image
I would guess the who is directly below the what element, and on the same level. If what they're saying becomes longer, it'll push their name down as well. Try removing an indent from the who part, or placing it inside its own vbox/hbox to contain it.
Re: Namebox that is part of the textbox image
It worked!!! I did as you said and I was able to do it! (Just had to readjust the parameters again. Thanks a bunch!!!
Now for the centering… this is where I put the code to implement the name to be centered. Am I doing it right? Because it's not centering at all : (
Now for the centering… this is where I put the code to implement the name to be centered. Am I doing it right? Because it's not centering at all : (
Code: Select all
## ---------- Name Box ---------------------
style.say_label.font = "comicbd.ttf"
style.say_label.xcenter = 0.5
style.say_label.text_align = 0.5 #0.0 left-align, 0.5 centre, 1.0 right-align
style.say_label.size =18
style.say_label.bold = False
style.say_label.outlines = [(1, "#000000", 0, 0)]
## ----- Frame (expandable) ------------------------
# style.say_who_window.background = Frame("whobox.png", 0, 0)
## ---- No Frame (Not expandable) ---------------
style.say_who_window.background = "whoboxi.png"
style.say_who_window.left_padding = 00
style.say_who_window.right_padding = 00
style.say_who_window.top_padding = 00
style.say_who_window.bottom_padding = 0
style.say_who_window.left_margin = 90
style.say_who_window.right_margin = 750
style.say_who_window.top_margin = -188
style.say_who_window.bottom_margin = 0
style.say_who_window.yminimum = 10
style.say_who_window.xminimum = 10
- SinnyROM
- Regular
- Posts: 166
- Joined: Mon Jul 08, 2013 12:25 am
- Projects: Blue Birth
- Organization: Cosmic Static Games
- Contact:
Re: Namebox that is part of the textbox image
A few things are apparent now, and I figured out how to get centring to work after some fiddling.
Instead of using the margin property to position the namebox, use xpos/ypos, or xalign/yalign. Negative margin doesn't really make sense. Then you can properly use Frame for the namebox background, like you have in your commented code. I'm afraid you'll have to go through repositioning it again!
I couldn't get text_align to work either, but you had xcenter there already which should work.
Instead of using the margin property to position the namebox, use xpos/ypos, or xalign/yalign. Negative margin doesn't really make sense. Then you can properly use Frame for the namebox background, like you have in your commented code. I'm afraid you'll have to go through repositioning it again!
I couldn't get text_align to work either, but you had xcenter there already which should work.
Code: Select all
## ---------- Name Box ---------------------
style.say_label.font = "comicbd.ttf"
style.say_label.xcenter = 0.5
#style.say_label.text_align = 0.5 #0.0 left-align, 0.5 centre, 1.0 right-align
style.say_label.size =18
style.say_label.bold = False
style.say_label.outlines = [(1, "#000000", 0, 0)]
## ----- Frame (expandable) ------------------------
style.say_who_window.background = Frame("ui/namebox.png", 0, 0)
## ---- No Frame (Not expandable) ---------------
#style.say_who_window.background = "ui/namebox.png"
style.say_who_window.left_padding = 00
style.say_who_window.right_padding = 00
style.say_who_window.top_padding = 00
style.say_who_window.bottom_padding = 0
#style.say_who_window.left_margin = 90
#style.say_who_window.right_margin = 750
#style.say_who_window.top_margin = -188
#style.say_who_window.bottom_margin = 0
style.say_who_window.xalign = 100 # or xpos
style.say_who_window.yalign = 50 # or ypos
style.say_who_window.yminimum = 10
style.say_who_window.xminimum = 10Who is online
Users browsing this forum: Ocelot
