Page 1 of 1

How to Position Text in History box?

Posted: Fri Dec 25, 2015 4:13 am
by Panda_nui
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
    

Re: How to Position Text in History box?

Posted: Mon Dec 28, 2015 2:39 pm
by Hijiri
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