I have an issue with a history screen. I want the textbox content to be layed out based on each size + space inbetween rather than fixed sizes. Hence i though i should use viewport. However, it completly ignores it and simply places everything in once place at the top. I already tried everything i think could help but all didnt worked.
Its my first time making a history screen, so i am unsure if/what i did wrong so any help would be appreticiated!
The code:
Code: Select all
screen history():
tag menu
add "gui/overlay/white_overlay.png"
add "gui/chatlog_bg.png" xanchor 0.5 xpos 390 yalign 0.5
## Avoid predicting this screen, as it can be very large.
predict False
viewport:
style_prefix "history"
yinitial 1.0
xanchor 0.5
xpos 390
yanchor 0.0
ypos 150
xmaximum 356
ymaximum 610
draggable True
mousewheel True
scrollbars "vertical"
for h in _history_list:
window:
## This lays things out properly if history_height is None.
has fixed:
yfit True
if h.who:
label h.who:
style "history_name"
## Take the color of the who text from the Character, if
## set.
if "color" in h.who_args:
text_color h.who_args["color"]
$ what = renpy.filter_text_tags(h.what, allow=gui.history_allow_tags)
text what
if not _history_list:
label _("The dialogue history is empty.")
##Dont Change
textbutton _("Close") action Return() xpos 390 xanchor 0.5 ypos 800 yanchor 0.5 style "history_close_button"
## History Style
## This determines what tags are allowed to be displayed on the history screen.
define gui.history_allow_tags = set()
## Removes Textbox
style history_window is empty
## Dialoge Boxes Inside History Box
style history_window:
xfill True
ysize None
## Name
style history_name:
xpos 20
xanchor 0.0
yanchor 0.0
ypos 0.0
style history_name_text:
font "fonts/Crimson.ttf"
yalign 0.5
xalign 0.5
size 26
text_align 0.0
## Dialogue
style history_text:
font "fonts/OpenSans.ttf"
size 18
xpos 50
xanchor 0.0
ypos 37
yanchor 0.0
xsize 240
min_width 240
text_align 0.0
layout "tex"
style history_label:
xfill True
style history_label_text:
xalign 0.5
## Scrollbar
style history_vscrollbar:
base_bar "gui/scrollbar/chatlog_scrollbar.png"
thumb "gui/scrollbar/scroll_indicator.png"
thumb_offset 17
top_gutter 10
bottom_gutter 5
xmaximum 24
ymaximum 610
## Close Menu Button
style history_close_button:
xalign 0.5
style history_close_button_text:
font "fonts/Crimson.ttf"
size 19
idle_color "#ad8568"
hover_color "#d6c09c"
selected_hover_color "#d6c09c"
selected_idle_color "#d6c09c"
xalign 0.5