How to Position Text in History box?

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
Panda_nui
Regular
Posts: 44
Joined: Mon Jul 02, 2012 10:48 am
Projects: re:_night
Location: in your closet
Contact:

How to Position Text in History box?

#1 Post by Panda_nui » Fri Dec 25, 2015 4:13 am

Hey! I've been spending hours on playing with the history box and for some reason i can't really position the text properly...
It always starts from the middle and there's always this weird margin on the top..

I was wondering if anyone could tell me how I can position more to the left ;___;
I appreciate it so much!!

This is my code for the history box, the rest is all c/p from the cookbook >__<

Code: Select all

init -3 python:
    # config.game_menu.insert(1,( "text_history", u"Text History", ui.jumps("text_history_screen"), 'not main_menu'))

    # styles
    #This is the style of the window, position and bg
    style.readback_window.background = None
    style.readback_window.xmaximum = 1050
    style.readback_window.ymaximum = 700
    style.readback_window.yalign = 50

    #This is for the actual scrolling part
    style.readback_frame.background = None
    style.readback_frame.right_padding = 30
    style.readback_frame.top_padding = 24
    style.readback_frame.bottom_padding = 40
    style.readback_frame.xmargin = 5
    style.readback_frame.ymargin = 5
    style.readback_frame.xmaximum = 1000
    style.readback_frame.ymaximum = 500
    style.readback_frame.xalign = 0.7
    #style.readback_frame.top_margin = 50
    #style.readback_frame.bottom_margin = 80
    #style.readback_frame.xfill = True
    #style.readback_frame.yfill = True
    
    #text
    style.readback_text.color = "#fff"

    #this returns you back to the game
    style.create("readback_button", "readback_text")
    style.readback_button.background = None
    
    style.create("readback_button_text", "readback_text")
    style.readback_button_text.selected_color = "#f12"
    style.readback_button_text.hover_color = "#f12"
    
    style.readback_label_text.bold = True
    
    # starts adding new config variables
    config.locked = False 
    
    # Configuration Variable for Text History 
    config.readback_buffer_length = 100 # number of lines stored
    config.readback_full = True # True = completely replaces rollback, False = readback accessible from game menu only (dev mode)
    config.readback_disallowed_tags = ["size"] # a list of tags that will be removed in the text history
    config.readback_choice_prefix = ">> "   # this is prefixed to the choices the user makes in readback
    
    # ends adding new config variables
    config.locked = True
    
Attachments
help.png

User avatar
Hijiri
Eileen-Class Veteran
Posts: 1518
Joined: Sun Mar 25, 2012 6:35 pm
Completed: Death Rule:lost code Overdrive Edition, Where the White Doves Rest-Tsumihanseishi
Projects: Death Rule: Killing System
Organization: MESI Games
IRC Nick: Hizi
Tumblr: mesigames
Skype: kurotezuka
itch: hijiri
Location: Los Angeles
Contact:

Re: How to Position Text in History box?

#2 Post by Hijiri » Mon Dec 28, 2015 2:39 pm

yalign tells the engine where to align the thing on screen. In this instance, you told renpy to align it dead center. Change it to ypos and that should fix the problem
Image Image
"Perfection goal that always changes. Can pursue, cannot obtain."

Post Reply

Who is online

Users browsing this forum: No registered users