Trouble with namebox

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
User avatar
AznGreen
Newbie
Posts: 11
Joined: Thu Jul 04, 2013 11:34 am
Contact:

Trouble with namebox

#1 Post by AznGreen »

I'm having trouble positioning the name of my characters. Instead of using another box to put their names in it, I just want to move their name (in this case ???) into the blue box in the picture. I've been searching for over 30 minutes and I'm still lost :/
Attachments
wer.png

User avatar
NoahSindri
Regular
Posts: 69
Joined: Tue May 07, 2013 1:05 pm
Projects: Truculence, Noraska:The cats valley
Organization: Sunset Productions
Location: Cyprus
Contact:

Re: Trouble with namebox

#2 Post by NoahSindri »

AznGreen wrote:I'm having trouble positioning the name of my characters. Instead of using another box to put their names in it, I just want to move their name (in this case ???) into the blue box in the picture. I've been searching for over 30 minutes and I'm still lost :/
You need to put the name on a window on it's own, to do this, place (show_two_window=True) behind the character's name in the defining like this:

Code: Select all

define R = Character('Zaniega', color ="#463E3F", show_two_window=True)

Also after you do this, go to the *screens* screen you will find this at the beginning:

Code: Select all

   
 # Defaults for side_image and two_window
    default side_image = ""
    default two_window = False
Change the False into True

This shall work ^^

User avatar
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: Trouble with namebox

#3 Post by OokamiKasumi »

AznGreen wrote:I'm having trouble positioning the name of my characters. Instead of using another box to put their names in it, I just want to move their name (in this case ???) into the blue box in the picture. I've been searching for over 30 minutes and I'm still lost :/
Okay, I was able to achieve this, in an 800x600 game:
textbox example.jpg
First by saving the textbox image to 800 px wide, then...

In script.rpy:

Code: Select all

    define a= Character('Arthur',
        color="99ccff", 
        ctc="ctc_blink",)
In options.rpy

Code: Select all

    #########################################
    ## -------------- Text box ----------------------
    ## Frame ------------------------
    style.window.background = Frame("ui/textbox modern.png", 0, 0)
    
    ## Margin is space surrounding the window, where the background
    ## is NOT drawn.

    style.window.left_margin = 0
    style.window.right_margin = 80
    style.window.top_margin = 0
    style.window.bottom_margin = -20   

    ## Padding is space inside the window, where the background is
    ## drawn.

    style.window.left_padding = 75
    style.window.right_padding = 85
    style.window.top_padding = 10
    style.window.bottom_padding = 20
    
    ## This is the minimum height of the window, including the margins
    ## and padding.
    
    style.window.yminimum = 175

    ## ---------- Name Box  ---------------------
    style.say_label.font = "LHFmisterkookyREG_0.TTF"    
    style.say_label.size = 30
    style.say_label.bold = False
    style.say_label.outlines = [(1, "#330000", 0, 0)] 
Then in screens.rpy

Code: Select all

##############################################################################
# Quick Menu
#
# A screen that's included by the default say screen, and adds quick access to
# several useful functions.
screen quick_menu:

    # Add an in-game quick menu.
    hbox:
        style_group "quick"
    
        xalign 0.98 # To the \<\ Left from the Right. 
        yalign 1.0 # Up from the bottom.

        # textbutton _("Q.Save") action QuickSave()
        # textbutton _("Q.Load") action QuickLoad()
        textbutton _("Main Menu") action MainMenu() 
        textbutton _("Save") action ShowMenu('save') 
        textbutton _("Load") action ShowMenu('load') 
        textbutton _("Skip") action Skip() 
        textbutton _("Auto") action Preference("auto-forward", "toggle") 
        
################################
init -2 python:
    style.quick_button.set_parent('default')
    style.quick_button.background = None

    # To move whole set, use xalign, above.

    style.quick_button.right_padding = 5
    style.quick_button.bottom_padding = 3
    style.quick_button.top_padding = 3
    
    ## --------------------------------------
    style.quick_button_text.set_parent('default')     
    
    # style.quick_button_text.font = "ALMAGRO_.TTF"
    style.quick_button_text.size = 16
    
    style.quick_button_text.idle_color = "#8888"
    style.quick_button_text.hover_color = "#ccc"
    style.quick_button_text.selected_idle_color = "#cc08"
    style.quick_button_text.selected_hover_color = "#cc0"
    style.quick_button_text.insensitive_color = "#4448"

    style.quick_button_text.drop_shadow = [(2, 2)] 
    style.quick_button_text.drop_shadow_color = "#000"
I hope that helps.
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed: For ALL my completed games visit: DarkErotica Games

"No amount of great animation will save a bad story." -- John Lasseter of Pixar

User avatar
AznGreen
Newbie
Posts: 11
Joined: Thu Jul 04, 2013 11:34 am
Contact:

Re: Trouble with namebox

#4 Post by AznGreen »

Oh thank you very much, guys. I messed around with the style.window's margin and padding for a bit and I managed to get it to work. Thank you again!

Post Reply

Who is online

Users browsing this forum: Google [Bot]