How to move character-specific textbox

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
charmandy
Newbie
Posts: 6
Joined: Sun Apr 09, 2017 2:21 am
Contact:

How to move character-specific textbox

#1 Post by charmandy »

I'm working on something simple; having a separate dialogue box for one of the characters. However, for some reason, it's aligned strangely.

Image

Where is the xalign / yalign options for this second text box? I have this code in script.rpy:

Code: Select all

define g = Character("GENGAR", image="gengar",window_left_padding=240,who_color="#ece8e8",window_background="gui/textbox_2.png",)
This is in screens.rpy for the default text box:

Code: Select all

background Image("gui/textbox.png", xalign=0.5, yalign=1.0)
I can figure out how to move the text around (the padding part of the code), but not the image of textbox_2.png itself. Help?

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: How to move character-specific textbox

#2 Post by Per K Grok »

charmandy wrote: Sun Jun 24, 2018 9:49 pm
---
I can figure out how to move the text around ---, but not the image of textbox_2.png itself. Help?
I think this will work.

In screens.rpy you copy the 'style window:' block.
Paste in the copy. Rename the second block 'window2'. Change the image part to 'textbox_2.png'.
So now you have 'style_window:' that will be the normal style and 'style_window2:' that you can call for when you want to use that.

Code: Select all

style window:
    xalign 0.5
    xfill True
    yalign gui.textbox_yalign
    ysize gui.textbox_height
    background Image("gui/textbox.png", xalign=0.5, yalign=1.0)

style window2:
    xalign 0.5
    xfill True
    yalign gui.textbox_yalign
    ysize gui.textbox_height
   background Image("gui/textbox_2.png", xalign=0.5, yalign=1.0)
You would then use 'window_style' to get the second background image including positioning the image.

Code: Select all

define g = Character("GENGAR", image="gengar",window_left_padding=240,who_color="#ece8e8",window_style="window2")
I hope this is what you are looking for. :)

charmandy
Newbie
Posts: 6
Joined: Sun Apr 09, 2017 2:21 am
Contact:

Re: How to move character-specific textbox

#3 Post by charmandy »

That worked perfectly!!!! Thank you so much!!!!

Post Reply

Who is online

Users browsing this forum: Semrush [Bot]