Namebox suddenly broke

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
Maou Zenigame
Regular
Posts: 66
Joined: Thu Nov 09, 2017 3:09 am
Contact:

Namebox suddenly broke

#1 Post by Maou Zenigame » Sat Jan 11, 2020 3:22 am

I just went to do some revising in my game, and for some reason the name text itself is blowing out the namebox image behind it now:
brokenname.png
As a reference, this is how it used to look:
EDrXG1PX4AAwDaQ[1].jpg
as well as the code in screens.rpy:

Code: Select all

## Make the namebox available for styling through the Character object.
init python:
    config.character_id_prefixes.append('namebox')

style window is default
style say_label is default
style say_dialogue is default
style say_thought is say_dialogue

style namebox is default
style namebox_label is say_label


style window:
    xalign 0.5
    xfill True
    yalign gui.textbox_yalign
    ysize gui.textbox_height

    background Image("gui/Textbox/textbox.png", xalign=0.5, yalign=1.0)

style namebox:
    xpos gui.name_xpos
    xanchor gui.name_xalign
    xsize gui.namebox_width
    ypos gui.name_ypos
    ysize gui.namebox_height

    background Frame("gui/Textbox/namebox.png", gui.namebox_borders, tile=gui.namebox_tile, xalign=gui.name_xalign)
    padding gui.namebox_borders.padding

style say_label:
    properties gui.text_properties("name", accent=True)
    xalign gui.name_xalign
    yalign 0.2
    outlines [ (3, "#632F1F", 0, 0),  (2, "#FFE0A3", 0, 0), (1, "#FFD884", 0, 0) ]

style say_dialogue:
    properties gui.text_properties("dialogue")

    xpos gui.dialogue_xpos
    xsize gui.dialogue_width
    ypos gui.dialogue_ypos
    outlines [ (1, "#000000", 0, 0), (0, "#000000", 2, 2) ]

As I haven't changed anything regarding the base coding in some time, my only guess is that this is related to an engine update.
Does anyone out there know how to fix this?

User avatar
that_wannabe_cat
Newbie
Posts: 9
Joined: Mon Oct 21, 2019 5:37 pm
Completed: My Vampire Girlfriend, Thea is Drowning, Dear Genny, The Puppet Whisperer (Programming)
Projects: Merely a Regret
itch: that-wannabe-cat
Contact:

Re: Namebox suddenly broke

#2 Post by that_wannabe_cat » Sat Jan 11, 2020 5:35 pm

Did you alter the name box at all in the gui?

Maou Zenigame
Regular
Posts: 66
Joined: Thu Nov 09, 2017 3:09 am
Contact:

Re: Namebox suddenly broke

#3 Post by Maou Zenigame » Sat Jan 11, 2020 5:47 pm

This is what I have in the Dialogue section of gui.rpy:

Code: Select all

## Dialogue ####################################################################
##
## These variables control how dialogue is displayed on the screen one line at a
## time.

## The height of the textbox containing dialogue.
define gui.textbox_height = 185

## The placement of the textbox vertically on the screen. 0.0 is the top, 0.5 is
## center, and 1.0 is the bottom.
define gui.textbox_yalign = 1.0


## The placement of the speaking character's name, relative to the textbox.
## These can be a whole number of pixels from the left or top, or 0.5 to center.
define gui.name_xpos = 280
define gui.name_ypos = -50

## The horizontal alignment of the character's name. This can be 0.0 for left-
## aligned, 0.5 for centered, and 1.0 for right-aligned.
define gui.name_xalign = 0.0

## The width, height, and borders of the box containing the character's name, or
## None to automatically size it.
define gui.namebox_width = None
define gui.namebox_height = 60

## The borders of the box containing the character's name, in left, top, right,
## bottom order.
define gui.namebox_borders = Borders(9, 9, 15, 1)

## If True, the background of the namebox will be tiled, if False, the
## background if the namebox will be scaled.
define gui.namebox_tile = False


## The placement of dialogue relative to the textbox. These can be a whole
## number of pixels relative to the left or top side of the textbox, or 0.5 to
## center.
define gui.dialogue_xpos = 310
define gui.dialogue_ypos = 20

## The maximum width of dialogue text, in pixels.
define gui.dialogue_width = 744

## The horizontal alignment of the dialogue text. This can be 0.0 for left-
## aligned, 0.5 for centered, and 1.0 for right-aligned.
define gui.dialogue_text_xalign = 0.0

User avatar
that_wannabe_cat
Newbie
Posts: 9
Joined: Mon Oct 21, 2019 5:37 pm
Completed: My Vampire Girlfriend, Thea is Drowning, Dear Genny, The Puppet Whisperer (Programming)
Projects: Merely a Regret
itch: that-wannabe-cat
Contact:

Re: Namebox suddenly broke

#4 Post by that_wannabe_cat » Sat Jan 11, 2020 8:40 pm

I mean the namebox image itself in the gui folder.

Though its hard to know what caused it to break if you don't know all the changes you made to the code.

Maou Zenigame
Regular
Posts: 66
Joined: Thu Nov 09, 2017 3:09 am
Contact:

Re: Namebox suddenly broke

#5 Post by Maou Zenigame » Sat Jan 11, 2020 9:02 pm

The namebox image was this:
namebox.png
namebox.png (23.07 KiB) Viewed 397 times
Same filename as the default.

And like I said before, it had been working just fine up until just now.

Just in case, here's the entire gui.rpy code:

Code: Select all

################################################################################
## Initialization
################################################################################

## The init offset statement causes the initialization statements in this file
## to run before init statements in any other file.
init offset = -2

## Calling gui.init resets the styles to sensible default values, and sets the
## width and height of the game.
init python:
    gui.init(1280, 720)



################################################################################
## GUI Configuration Variables
################################################################################


## Colors ######################################################################
##
## The colors of text in the interface.

## An accent color used throughout the interface to label and highlight text.
define gui.accent_color = '#003366'

## The color used for a text button when it is neither selected nor hovered.
define gui.idle_color = '#aaaaaa'

## The small color is used for small text, which needs to be brighter/darker to
## achieve the same effect.
define gui.idle_small_color = '#888888'

## The color that is used for buttons and bars that are hovered.
define gui.hover_color = '#003366'

## The color used for a text button when it is selected but not focused. A
## button is selected if it is the current screen or preference value.
define gui.selected_color = '#555555'

## The color used for a text button when it cannot be selected.
define gui.insensitive_color = '#aaaaaa7f'

## Colors used for the portions of bars that are not filled in. These are not
## used directly, but are used when re-generating bar image files.
define gui.muted_color = '#6684a3'
define gui.hover_muted_color = '#99adc1'

## The colors used for dialogue and menu choice text.
define gui.text_color = '#ffffff'
define gui.interface_text_color = '#ffffff'

## The colors used for name text.
define gui.name_text_color = "#2A4C72"


## Fonts and Font Sizes ########################################################

## The font used for in-game text.
define gui.text_font = "SignikaNegative-Regular.ttf"

## The font used for character names.
define gui.name_text_font = "Kingthings_Petrock.ttf"

## The font used for out-of-game text.
define gui.interface_text_font = "SignikaNegative-Regular.ttf"

## The size of normal dialogue text.
define gui.text_size = 25

## The size of character names.
define gui.name_text_size = 40

## The size of text in the game's user interface.
define gui.interface_text_size = 24

## The size of labels in the game's user interface.
define gui.label_text_size = 28

## The size of text on the notify screen.
define gui.notify_text_size = 16

## The size of the game's title.
define gui.title_text_size = 50


## Main and Game Menus #########################################################

## The images used for the main and game menus.
define gui.main_menu_background = "gui/Main Menu/mainmenu_bg.png"
define gui.game_menu_background = "gui/Main Menu/mainmenu_bg.png"

## Should we show the name and version of the game?
define gui.show_name = True


## Dialogue ####################################################################
##
## These variables control how dialogue is displayed on the screen one line at a
## time.

## The height of the textbox containing dialogue.
define gui.textbox_height = 185

## The placement of the textbox vertically on the screen. 0.0 is the top, 0.5 is
## center, and 1.0 is the bottom.
define gui.textbox_yalign = 1.0


## The placement of the speaking character's name, relative to the textbox.
## These can be a whole number of pixels from the left or top, or 0.5 to center.
define gui.name_xpos = 280
define gui.name_ypos = -50

## The horizontal alignment of the character's name. This can be 0.0 for left-
## aligned, 0.5 for centered, and 1.0 for right-aligned.
define gui.name_xalign = 0.0

## The width, height, and borders of the box containing the character's name, or
## None to automatically size it.
define gui.namebox_width = None
define gui.namebox_height = 60

## The borders of the box containing the character's name, in left, top, right,
## bottom order.
define gui.namebox_borders = Borders(9, 9, 15, 1)

## If True, the background of the namebox will be tiled, if False, the
## background if the namebox will be scaled.
define gui.namebox_tile = False


## The placement of dialogue relative to the textbox. These can be a whole
## number of pixels relative to the left or top side of the textbox, or 0.5 to
## center.
define gui.dialogue_xpos = 310
define gui.dialogue_ypos = 20

## The maximum width of dialogue text, in pixels.
define gui.dialogue_width = 744

## The horizontal alignment of the dialogue text. This can be 0.0 for left-
## aligned, 0.5 for centered, and 1.0 for right-aligned.
define gui.dialogue_text_xalign = 0.0


## Buttons #####################################################################
##
## These variables, along with the image files in gui/button, control aspects of
## how buttons are displayed.

## The width and height of a button, in pixels. If None, Ren'Py computes a size.
define gui.button_width = None
define gui.button_height = 36

## The borders on each side of the button, in left, top, right, bottom order.
define gui.button_borders = Borders(4, 4, 4, 4)

## If True, the background image will be tiled. If False, the background image
## will be linearly scaled.
define gui.button_tile = False

## The font used by the button.
define gui.button_text_font = gui.interface_text_font

## The size of the text used by the button.
define gui.button_text_size = gui.interface_text_size

## The color of button text in various states.
define gui.button_text_idle_color = gui.idle_color
define gui.button_text_hover_color = gui.hover_color
define gui.button_text_selected_color = gui.selected_color
define gui.button_text_insensitive_color = gui.insensitive_color

## The horizontal alignment of the button text. (0.0 is left, 0.5 is center, 1.0
## is right).
define gui.button_text_xalign = 0.0


## These variables override settings for different kinds of buttons. Please see
## the gui documentation for the kinds of buttons available, and what each is
## used for.
##
## These customizations are used by the default interface:

define gui.radio_button_borders = Borders(18, 4, 4, 4)

define gui.check_button_borders = Borders(18, 4, 4, 4)

define gui.confirm_button_text_xalign = 0.5

define gui.page_button_borders = Borders(10, 4, 10, 4)

define gui.quick_button_borders = Borders(10, 4, 10, 0)
define gui.quick_button_text_size = 14
define gui.quick_button_text_idle_color = gui.idle_small_color
define gui.quick_button_text_selected_color = gui.accent_color

## You can also add your own customizations, by adding properly-named variables.
## For example, you can uncomment the following line to set the width of a
## navigation button.

# define gui.navigation_button_width = 250


## Choice Buttons ##############################################################
##
## Choice buttons are used in the in-game menus.

define gui.choice_button_width = 816
define gui.choice_button_height = 95
define gui.choice_button_tile = False
define gui.choice_button_borders = Borders(100, 5, 20, 0)
define gui.choice_button_text_font = gui.text_font
define gui.choice_button_text_size = 25
define gui.choice_button_text_xalign = 0.5
define gui.choice_button_text_idle_color = "#cccccc"
define gui.choice_button_text_hover_color = "#ffffff"


## File Slot Buttons ###########################################################
##
## A file slot button is a special kind of button. It contains a thumbnail
## image, and text describing the contents of the save slot. A save slot uses
## image files in gui/button, like the other kinds of buttons.

## The save slot button.
define gui.slot_button_width = 276
define gui.slot_button_height = 206
define gui.slot_button_borders = Borders(10, 10, 10, 10)
define gui.slot_button_text_size = 14
define gui.slot_button_text_xalign = 0.5
define gui.slot_button_text_idle_color = gui.idle_small_color
define gui.slot_button_text_selected_idle_color = gui.selected_color
define gui.slot_button_text_selected_hover_color = gui.hover_color

## The width and height of thumbnails used by the save slots.
define config.thumbnail_width = 213
define config.thumbnail_height = 122

## The number of columns and rows in the grid of save slots.
define gui.file_slot_cols = 1
define gui.file_slot_rows = 2


## Positioning and Spacing #####################################################
##
## These variables control the positioning and spacing of various user interface
## elements.

## The position of the left side of the navigation buttons, relative to the left
## side of the screen.
define gui.navigation_xpos = 40

## The vertical position of the skip indicator.
define gui.skip_ypos = 10

## The vertical position of the notify screen.
define gui.notify_ypos = 45

## The spacing between menu choices.
define gui.choice_spacing = 22

## Buttons in the navigation section of the main and game menus.
define gui.navigation_spacing = 0

## Controls the amount of spacing between preferences.
define gui.pref_spacing = 10

## Controls the amount of spacing between preference buttons.
define gui.pref_button_spacing = 0

## The spacing between file page buttons.
define gui.page_spacing = 0

## The spacing between file slots.
define gui.slot_spacing = 10

## The position of the main menu text.
define gui.main_menu_text_xalign = -250


## Frames ######################################################################
##
## These variables control the look of frames that can contain user interface
## components when an overlay or window is not present.

## Generic frames.
define gui.frame_borders = Borders(0, 0, 0, 0)

## The frame that is used as part of the confirm screen.
define gui.confirm_frame_borders = Borders(40, 40, 40, 40)

## The frame that is used as part of the skip screen.
define gui.skip_frame_borders = Borders(16, 5, 50, 5)

## The frame that is used as part of the notify screen.
define gui.notify_frame_borders = Borders(16, 5, 40, 5)

## Should frame backgrounds be tiled?
define gui.frame_tile = False


## Bars, Scrollbars, and Sliders ###############################################
##
## These control the look and size of bars, scrollbars, and sliders.
##
## The default GUI only uses sliders and vertical scrollbars. All of the other
## bars are only used in creator-written screens.

## The height of horizontal bars, scrollbars, and sliders. The width of vertical
## bars, scrollbars, and sliders.
define gui.bar_size = 41
define gui.slider_size = 45
define gui.scrollbar_size = 46

## True if bar images should be tiled. False if they should be linearly scaled.
define gui.bar_tile = False
define gui.scrollbar_tile = False
define gui.slider_tile = False

## Horizontal borders.
define gui.bar_borders = Borders(4, 4, 4, 4)
define gui.scrollbar_borders = Borders(4, 4, 4, 4)
define gui.slider_borders = Borders(4, 4, 4, 4)

## Vertical borders.
define gui.vbar_borders = Borders(4, 4, 4, 4)
define gui.vscrollbar_borders = Borders(4, 4, 4, 4)
define gui.vslider_borders = Borders(4, 4, 4, 4)

## What to do with unscrollable scrollbars in the gui. "hide" hides them, while
## None shows them.
define gui.unscrollable = "hide"


## History #####################################################################
##
## The history screen displays dialogue that the player has already dismissed.

## The number of blocks of dialogue history Ren'Py will keep.
define config.history_length = 250

## The height of a history screen entry, or None to make the height variable at
## the cost of performance.
define gui.history_height = None

## The position, width, and alignment of the label giving the name of the
## speaking character.
define gui.history_name_xpos = 0
define gui.history_name_ypos = 0
define gui.history_name_width = 155
define gui.history_name_xalign = 0.0

## The position, width, and alignment of the dialogue text.
define gui.history_text_xpos = 0
define gui.history_text_ypos = 30
define gui.history_text_width = 1000
define gui.history_text_xalign = 0.0


## NVL-Mode ####################################################################
##
## The NVL-mode screen displays the dialogue spoken by NVL-mode characters.

## The borders of the background of the NVL-mode background window.
define gui.nvl_borders = Borders(0, 10, 0, 20)

## The maximum number of NVL-mode entries Ren'Py will display. When more entries
## than this are to be show, the oldest entry will be removed.
define gui.nvl_list_length = 6

## The height of an NVL-mode entry. Set this to None to have the entries
## dynamically adjust height.
define gui.nvl_height = 115

## The spacing between NVL-mode entries when gui.nvl_height is None, and between
## NVL-mode entries and an NVL-mode menu.
define gui.nvl_spacing = 10

## The position, width, and alignment of the label giving the name of the
## speaking character.
define gui.nvl_name_xpos = 430
define gui.nvl_name_ypos = 0
define gui.nvl_name_width = 150
define gui.nvl_name_xalign = 1.0

## The position, width, and alignment of the dialogue text.
define gui.nvl_text_xpos = 450
define gui.nvl_text_ypos = 8
define gui.nvl_text_width = 590
define gui.nvl_text_xalign = 0.0

## The position, width, and alignment of nvl_thought text (the text said by the
## nvl_narrator character.)
define gui.nvl_thought_xpos = 240
define gui.nvl_thought_ypos = 0
define gui.nvl_thought_width = 780
define gui.nvl_thought_xalign = 0.0

## The position of nvl menu_buttons.
define gui.nvl_button_xpos = 450
define gui.nvl_button_xalign = 0.0

## Localization ################################################################

## This controls where a line break is permitted. The default is suitable
## for most languages. A list of available values can be found at https://
## www.renpy.org/doc/html/style_properties.html#style-property-language

define gui.language = "unicode"


################################################################################
## Mobile devices
################################################################################

init python:

    ## This increases the size of the quick buttons to make them easier to touch
    ## on tablets and phones.
    if renpy.variant("touch"):

        gui.quick_button_borders = Borders(40, 14, 40, 0)

    ## This changes the size and spacing of various GUI elements to ensure they
    ## are easily visible on phones.
    if renpy.variant("small"):

        ## Font sizes.
        gui.text_size = 30
        gui.name_text_size = 36
        gui.notify_text_size = 25
        gui.interface_text_size = 30
        gui.button_text_size = 30
        gui.label_text_size = 34

        ## Adjust the location of the textbox.
        gui.textbox_height = 240
        gui.name_xpos = 80
        gui.text_xpos = 90
        gui.text_width = 1100

        ## Change the size and spacing of various things.
        gui.slider_size = 36

        gui.choice_button_width = 1240

        gui.navigation_spacing = 20
        gui.pref_button_spacing = 10

        gui.history_height = 190
        gui.history_text_width = 690

        gui.quick_button_text_size = 20

        ## File button layout.
        gui.file_slot_cols = 2
        gui.file_slot_rows = 2

        ## NVL-mode.
        gui.nvl_height = 170

        gui.nvl_name_width = 305
        gui.nvl_name_xpos = 325

        gui.nvl_text_width = 915
        gui.nvl_text_xpos = 345
        gui.nvl_text_ypos = 5

        gui.nvl_thought_width = 1240
        gui.nvl_thought_xpos = 20

        gui.nvl_button_width = 1240
        gui.nvl_button_xpos = 20


And here's the screens.rpy:

Code: Select all

################################################################################
## Initialization
################################################################################

init offset = -1


################################################################################
## Styles
################################################################################

style default:
    properties gui.text_properties()
    language gui.language

style input:
    properties gui.text_properties("input", accent=True)
    adjust_spacing False

style hyperlink_text:
    properties gui.text_properties("hyperlink", accent=True)
    hover_underline True

style gui_text:
    properties gui.text_properties("interface")


style button:
    properties gui.button_properties("button")

style button_text is gui_text:
    properties gui.text_properties("button")
    yalign 0.5


style label_text is gui_text:
    properties gui.text_properties("label", accent=True)

style prompt_text is gui_text:
    properties gui.text_properties("prompt")


style bar:
    ysize gui.bar_size
    left_bar Frame("gui/Settings/empty.png", gui.bar_borders, tile=gui.bar_tile)
    right_bar Frame("gui/Settings/full.png", gui.bar_borders, tile=gui.bar_tile)

style vbar:
    xsize gui.bar_size
    top_bar Frame("gui/bar/top.png", gui.vbar_borders, tile=gui.bar_tile)
    bottom_bar Frame("gui/bar/bottom.png", gui.vbar_borders, tile=gui.bar_tile)

style scrollbar:
    ysize gui.scrollbar_size
    base_bar Frame("gui/scrollbar/horizontal_[prefix_]bar.png", gui.scrollbar_borders, tile=gui.scrollbar_tile)
    thumb Frame("gui/scrollbar/horizontal_[prefix_]thumb.png", gui.scrollbar_borders, tile=gui.scrollbar_tile)

style vscrollbar:
    xsize gui.scrollbar_size
    base_bar Frame("gui/History/pg_scroller.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile)
    thumb "gui/History/pg_thumb.png"

style slider:
    ysize gui.slider_size
    base_bar Frame("gui/Settings/empty.png", gui.slider_borders, tile=gui.slider_tile)
    thumb "gui/Settings/thumb.png"

style vslider:
    xsize gui.slider_size
    base_bar Frame("gui/History/pg_scroller.png", gui.vslider_borders, tile=gui.slider_tile)
    thumb "gui/History/pg_thumb.png"


################################################################################
## In-game screens
################################################################################


## Say screen ##################################################################
##
## The say screen is used to display dialogue to the player. It takes two
## parameters, who and what, which are the name of the speaking character and
## the text to be displayed, respectively. (The who parameter can be None if no
## name is given.)
##
## This screen must create a text displayable with id "what", as Ren'Py uses
## this to manage text display. It can also create displayables with id "who"
## and id "window" to apply style properties.
##
## https://www.renpy.org/doc/html/screen_special.html#say

screen say(who, what):
    style_prefix "say"

    window:
        id "window"

        if who is not None:

            window:
                id "namebox"
                style "namebox"
                text who id "who"

        text what id "what"


    ## If there's a side image, display it above the text. Do not display on the
    ## phone variant - there's no room.
    if not renpy.variant("small"):
        add SideImage() xalign 0.0 yalign 1.0


## Make the namebox available for styling through the Character object.
init python:
    config.character_id_prefixes.append('namebox')

style window is default
style say_label is default
style say_dialogue is default
style say_thought is say_dialogue

style namebox is default
style namebox_label is say_label


style window:
    xalign 0.5
    xfill True
    yalign gui.textbox_yalign
    ysize gui.textbox_height

    background Image("gui/Textbox/textbox.png", xalign=0.5, yalign=1.0)

style namebox:
    xpos gui.name_xpos
    xanchor gui.name_xalign
    xsize gui.namebox_width
    ypos gui.name_ypos
    ysize gui.namebox_height

    background Frame("gui/Textbox/namebox.png", gui.namebox_borders, tile=gui.namebox_tile, xalign=gui.name_xalign)
    padding gui.namebox_borders.padding

style say_label:
    properties gui.text_properties("name", accent=True)
    xalign gui.name_xalign
    yalign 0.2
    outlines [ (3, "#632F1F", 0, 0),  (2, "#FFE0A3", 0, 0), (1, "#FFD884", 0, 0) ]

style say_dialogue:
    properties gui.text_properties("dialogue")

    xpos gui.dialogue_xpos
    xsize gui.dialogue_width
    ypos gui.dialogue_ypos
    outlines [ (1, "#000000", 0, 0), (0, "#000000", 2, 2) ]


## Input screen ################################################################
##
## This screen is used to display renpy.input. The prompt parameter is used to
## pass a text prompt in.
##
## This screen must create an input displayable with id "input" to accept the
## various input parameters.
##
## https://www.renpy.org/doc/html/screen_special.html#input

screen input(prompt):
    style_prefix "input"

    window:

        vbox:
            xalign gui.dialogue_text_xalign
            xpos gui.dialogue_xpos
            xsize gui.dialogue_width
            ypos gui.dialogue_ypos

            text prompt style "input_prompt"
            input id "input"

style input_prompt is default

style input_prompt:
    xalign gui.dialogue_text_xalign
    properties gui.text_properties("input_prompt")

style input:
    xalign gui.dialogue_text_xalign
    xmaximum gui.dialogue_width


## Choice screen ###############################################################
##
## This screen is used to display the in-game choices presented by the menu
## statement. The one parameter, items, is a list of objects, each with caption
## and action fields.
##
## http://www.renpy.org/doc/html/screen_special.html#choice

screen choice(items):
    style_prefix "choice"

    vbox:
        for i in items:
            textbutton i.caption action i.action


## When this is true, menu captions will be spoken by the narrator. When false,
## menu captions will be displayed as empty buttons.
define config.narrator_menu = True


style choice_vbox is vbox
style choice_button is button
style choice_button_text is button_text

style choice_vbox:
    xalign 0.5
    ypos 270
    yanchor 0.5

    spacing gui.choice_spacing

style choice_button is default:
    properties gui.button_properties("choice_button")

style choice_button_text:
    font  "SignikaNegative-Regular.ttf"
    size  24
    color  "#E9D052"
    hover_color  "#ffffff"

    xalign 0.5
    yalign 0.5

    outlines  [(1, "#330000", 0, 0)]        
    hover_outlines  [(1, "#660066", 0, 0)]

    drop_shadow  [(2, 2)] 
    drop_shadow_color "#663300"


## Quick Menu screen ###########################################################
##
## The quick menu is displayed in-game to provide easy access to the out-of-game
## menus.

screen quick_menu():

    ## Ensure this appears on top of other screens.
    zorder 100
    key "q" action QuickSave() #Set the Q key in your keyboard to Quicksave when pressed
    key "l" action QuickLoad()  #Same for L key
    key "h" action ShowMenu("history")
    key "K_SPACE" action HideInterface()
    key "mousedown_4" action ShowMenu("history")
    #key "K_PAGEUP" action ShowMenu("history")

    
    if quick_menu:
        
        imagemap:
            ground 'gui/Textbox/qmenu_idle-001.png'
            idle 'gui/Textbox/qmenu_idle.png'
            hover 'gui/Textbox/qmenu_hover.png'
            selected_idle 'gui/Textbox/qmenu_selected_idle.png'
            selected_hover 'gui/Textbox/qmenu_selected_hover.png'
            
            alpha False
            
            hotspot (1144, 497, 120, 36) action Preference("auto-forward", "toggle")
            hotspot (1144, 543, 120, 36) action Skip()
            hotspot (1144, 588, 120, 36) action ShowMenu("save")
            hotspot (1144, 631, 120, 36) action ShowMenu("load")
            hotspot (1144, 677, 120, 36) action ShowMenu("preferences")


## This code ensures that the quick_menu screen is displayed in-game, whenever
## the player has not explicitly hidden the interface.
init python:
    config.overlay_screens.append("quick_menu")

default quick_menu = True

style quick_button is default
style quick_button_text is button_text

style quick_button:
    properties gui.button_properties("quick_button")

style quick_button_text:
    properties gui.button_text_properties("quick_button")


################################################################################
## Main and Game Menu Screens
################################################################################

## Navigation screen ###########################################################
##
## This screen is included in the main and game menus, and provides navigation
## to other menus, and to start the game.

screen navigation():

    vbox:
        style_prefix "navigation"


        if main_menu:

            imagemap:
                ground "gui/Main Menu/mainmenu_bg.png"
                idle "gui/Main Menu/mainmenu_hover.png"
                hover "gui/Main Menu/mainmenu_idle.png"
                
                alpha False
                # This is so that everything transparent is invisible to the cursor. 
                
                hotspot (1007, 276, 237, 64) action Start()
                hotspot (1007, 361, 238, 64) action ShowMenu("load")
                hotspot (1007, 438, 238, 64) action ShowMenu("preferences")
                #hotspot (1007, 523, 238, 64) action ShowMenu("extra")
                hotspot (1002, 608, 238, 64) action Quit(confirm=False)

        else:

            imagemap:
                ground "gui/Main Menu/mainmenu_bg.png"
                idle "gui/Navigation/navmenu_idle.png"
                hover "gui/Navigation/navmenu_hover.png"
                selected_idle 'gui/Navigation/navmenu_selected_idle.png'
                selected_hover 'gui/Navigation/navmenu_selected_hover.png'
                
                alpha False
                # This is so that everything transparent is invisible to the cursor. 
                
                hotspot (30, 285, 238, 65) action Return()
                hotspot (30, 361, 239, 65) action ShowMenu("preferences")
                hotspot (30, 442, 238, 65) action ShowMenu("save")
                hotspot (30, 516, 238, 65) action ShowMenu("load")
                hotspot (30, 597, 238, 65) action MainMenu()
                
        if renpy.variant("pc"):

            ## Help isn't necessary or relevant to mobile devices.
            textbutton _("Help") action ShowMenu("help")

            ## The quit button is banned on iOS and unnecessary on Android.
            textbutton _("Quit") action Quit(confirm=not main_menu)


style navigation_button is gui_button
style navigation_button_text is gui_button_text

style navigation_button:
    size_group "navigation"
    properties gui.button_properties("navigation_button")

style navigation_button_text:
    properties gui.button_text_properties("navigation_button")


## Main Menu screen ############################################################
##
## Used to display the main menu when Ren'Py starts.
##
## https://www.renpy.org/doc/html/screen_special.html#main-menu

screen main_menu():

    ## This ensures that any other menu screen is replaced.
    tag menu

    style_prefix "main_menu"

    add gui.main_menu_background

    ## This empty frame darkens the main menu.
    frame:
        pass

    ## The use statement includes another screen inside this one. The actual
    ## contents of the main menu are in the navigation screen.
    use navigation

    #if gui.show_name:

        #vbox:
            #text "[config.name!t]":
                #style "main_menu_title"

            #text "[config.version]":
                #style "main_menu_version"


style main_menu_frame is empty
style main_menu_vbox is vbox
style main_menu_text is gui_text
style main_menu_title is main_menu_text
style main_menu_version is main_menu_text

style main_menu_frame:
    xsize 280
    yfill True

    #background "gui/overlay/main_menu.png"

style main_menu_vbox:
    xalign 1.0
    xoffset -20
    xmaximum 800
    yalign 0.5
    yoffset -20

style main_menu_text:
    properties gui.text_properties("main_menu", accent=True)

style main_menu_title:
    properties gui.text_properties("title")

style main_menu_version:
    properties gui.text_properties("version")


## Game Menu screen ############################################################
##
## This lays out the basic common structure of a game menu screen. It's called
## with the screen title, and displays the background, title, and navigation.
##
## The scroll parameter can be None, or one of "viewport" or "vpgrid". When
## this screen is intended to be used with one or more children, which are
## transcluded (placed) inside it.

screen game_menu(title, scroll=None, yinitial=0.0):

    style_prefix "game_menu"

    if main_menu:
        add gui.main_menu_background
    else:
        add gui.game_menu_background

    frame:
        style "game_menu_outer_frame"

        hbox:

            ## Reserve space for the navigation section.
            frame:
                style "game_menu_navigation_frame"

            frame:
                style "game_menu_content_frame"

                if scroll == "viewport":

                    viewport:
                        yinitial yinitial
                        scrollbars "vertical"
                        mousewheel True
                        draggable True
                        pagekeys True

                        side_yfill True

                        vbox:
                            transclude

                elif scroll == "vpgrid":

                    vpgrid:
                        cols 1
                        yinitial yinitial

                        scrollbars "vertical"
                        mousewheel True
                        draggable True
                        pagekeys True

                        side_yfill True

                        transclude

                else:

                    transclude

    use navigation

    textbutton _("Return"):
        style "return_button"

        action Return()

    label title

    if main_menu:
        key "game_menu" action ShowMenu("main_menu")


style game_menu_outer_frame is empty
style game_menu_navigation_frame is empty
style game_menu_content_frame is empty
style game_menu_viewport is gui_viewport
style game_menu_side is gui_side
style game_menu_scrollbar is gui_vscrollbar

style game_menu_label is gui_label
style game_menu_label_text is gui_label_text

style return_button is navigation_button
style return_button_text is navigation_button_text

style game_menu_outer_frame:
    bottom_padding 30
    top_padding 120

    #background "gui/overlay/game_menu.png"

style game_menu_navigation_frame:
    xsize 280
    yfill True

style game_menu_content_frame:
    left_margin 40
    right_margin 20
    top_margin 10

style game_menu_viewport:
    xsize 920

style game_menu_vscrollbar:
    unscrollable gui.unscrollable

style game_menu_side:
    spacing 10

style game_menu_label:
    xpos 50
    ysize 120

style game_menu_label_text:
    size gui.title_text_size
    color gui.accent_color
    yalign 0.5

style return_button:
    xpos gui.navigation_xpos
    yalign 1.0
    yoffset -30


## About screen ################################################################
##
## This screen gives credit and copyright information about the game and Ren'Py.
##
## There's nothing special about this screen, and hence it also serves as an
## example of how to make a custom screen.

screen about():

    tag menu

    ## This use statement includes the game_menu screen inside this one. The
    ## vbox child is then included inside the viewport inside the game_menu
    ## screen.
    use game_menu(_("About"), scroll="viewport"):

        style_prefix "about"

        vbox:

            label "[config.name!t]"
            text _("Version [config.version!t]\n")

            ## gui.about is usually set in options.rpy.
            if gui.about:
                text "[gui.about!t]\n"

            text _("Made with {a=https://www.renpy.org/}Ren'Py{/a} [renpy.version_only].\n\n[renpy.license!t]")


## This is redefined in options.rpy to add text to the about screen.
define gui.about = ""


style about_label is gui_label
style about_label_text is gui_label_text
style about_text is gui_text

style about_label_text:
    size gui.label_text_size


## Load and Save screens #######################################################
##
## These screens are responsible for letting the player save the game and load
## it again. Since they share nearly everything in common, both are implemented
## in terms of a third screen, file_slots.
##
## https://www.renpy.org/doc/html/screen_special.html#save https://
## www.renpy.org/doc/html/screen_special.html#load

screen save():

    # This ensures that any other menu screen is replaced.
    tag menu

    frame:
        # The buttons at the top allow the user to pick a
        # page of files.
        imagemap:
            ground "gui/SaveLoad/save_bg.png"
            idle "gui/Navigation/navmenu_idle.png"
            hover "gui/Navigation/navmenu_hover.png"
            selected_idle 'gui/Navigation/navmenu_selected_idle.png'
            selected_hover 'gui/Navigation/navmenu_selected_hover.png'
            
            alpha False
            # This is so that everything transparent is invisible to the cursor. 
            
            hotspot (30, 285, 238, 65) action Return()
            hotspot (30, 361, 239, 65) action ShowMenu("preferences")
            hotspot (30, 442, 238, 65) action ShowMenu("save")
            hotspot (30, 516, 238, 65) action ShowMenu("load")
            hotspot (30, 597, 238, 65) action MainMenu()

        imagemap:
            ground "gui/SaveLoad/saveload_idle.png"
            idle "gui/SaveLoad/saveload_idle.png"
            hover "gui/SaveLoad/saveload_hover.png"
            selected_idle "gui/SaveLoad/saveload_selected_idle.png"
            selected_hover "gui/SaveLoad/saveload_selected_hover.png"
            
            cache False
            alpha False
         
            hotspot (1085, 184, 81, 66) clicked FilePage(1)
            hotspot (1085, 281, 83, 66) clicked FilePage(2)
            hotspot (1085, 376, 83, 66) clicked FilePage(3)
            hotspot (1085, 470, 83, 66) clicked FilePage(4)
            hotspot (1084, 565, 83, 65) clicked FilePage(5)
            hotspot (550, 87, 172, 57) action ShowMenu("delete")
            hotspot (774, 87, 173, 58) action ShowMenu("quick")
            hotspot (1005, 86, 170, 59) action ShowMenu("auto")
            
            hotspot (318, 178, 731, 134) clicked FileSave(1):
                use load_save_slot (number=1)
            hotspot (318, 326, 729, 134) clicked FileSave(2):
                use load_save_slot (number=2)
            hotspot (318, 471, 732, 134) clicked FileSave(3):
                use load_save_slot (number=3)


screen load():

    # This ensures that any other menu screen is replaced.
    tag menu

    frame:
        # The buttons at the top allow the user to pick a
        # page of files.
        imagemap:
            ground "gui/SaveLoad/load_bg.png"
            idle "gui/Navigation/navmenu_idle.png"
            hover "gui/Navigation/navmenu_hover.png"
            selected_idle 'gui/Navigation/navmenu_selected_idle.png'
            selected_hover 'gui/Navigation/navmenu_selected_hover.png'
            
            alpha False
            # This is so that everything transparent is invisible to the cursor. 
            
            hotspot (30, 285, 238, 65) action Return()
            hotspot (30, 361, 239, 65) action ShowMenu("preferences")
            hotspot (30, 442, 238, 65) action ShowMenu("save")
            hotspot (30, 516, 238, 65) action ShowMenu("load")
            hotspot (30, 597, 238, 65) action MainMenu()

        imagemap:
            ground "gui/SaveLoad/saveload_idle.png"
            idle "gui/SaveLoad/saveload_idle.png"
            hover "gui/SaveLoad/saveload_hover.png"
            selected_idle "gui/SaveLoad/saveload_selected_idle.png"
            selected_hover "gui/SaveLoad/saveload_selected_hover.png"
            
            cache False
            alpha False
         
            hotspot (1085, 184, 81, 66) clicked FilePage(1)
            hotspot (1085, 281, 83, 66) clicked FilePage(2)
            hotspot (1085, 376, 83, 66) clicked FilePage(3)
            hotspot (1085, 470, 83, 66) clicked FilePage(4)
            hotspot (1084, 565, 83, 65) clicked FilePage(5)
            hotspot (550, 87, 172, 57) action ShowMenu("delete")
            hotspot (774, 87, 173, 58) action ShowMenu("quick")
            hotspot (1005, 86, 170, 59) action ShowMenu("auto")
            
            hotspot (318, 178, 731, 134) clicked FileLoad(1):
                use load_save_slot (number=1)
            hotspot (318, 326, 729, 134) clicked FileLoad(2):
                use load_save_slot (number=2)
            hotspot (318, 471, 732, 134) clicked FileLoad(3):
                use load_save_slot (number=3)
            
            

screen delete():

    # This ensures that any other menu screen is replaced.
    tag menu

    frame:
        # The buttons at the top allow the user to pick a
        # page of files.
        imagemap:
            ground "gui/SaveLoad/save_bg.png"
            idle "gui/Navigation/navmenu_idle.png"
            hover "gui/Navigation/navmenu_hover.png"
            selected_idle 'gui/Navigation/navmenu_selected_idle.png'
            selected_hover 'gui/Navigation/navmenu_selected_hover.png'
            
            alpha False
            # This is so that everything transparent is invisible to the cursor. 
            
            hotspot (30, 285, 238, 65) action Return()
            hotspot (30, 361, 239, 65) action ShowMenu("preferences")
            hotspot (30, 442, 238, 65) action ShowMenu("save")
            hotspot (30, 516, 238, 65) action ShowMenu("load")
            hotspot (30, 597, 238, 65) action MainMenu()

        imagemap:
            ground "gui/SaveLoad/saveload_idle.png"
            idle "gui/SaveLoad/saveload_idle.png"
            hover "gui/SaveLoad/saveload_hover.png"
            selected_idle "gui/SaveLoad/saveload_selected_idle.png"
            selected_hover "gui/SaveLoad/saveload_selected_hover.png"
            
            cache False
            alpha False
         
            hotspot (1085, 184, 81, 66) clicked FilePage(1)
            hotspot (1085, 281, 83, 66) clicked FilePage(2)
            hotspot (1085, 376, 83, 66) clicked FilePage(3)
            hotspot (1085, 470, 83, 66) clicked FilePage(4)
            hotspot (1084, 565, 83, 65) clicked FilePage(5)
            hotspot (550, 87, 172, 57) action ShowMenu("delete")
            hotspot (774, 87, 173, 58) action ShowMenu("quick")
            hotspot (1005, 86, 170, 59) action ShowMenu("auto")
            
            hotspot (318, 178, 731, 134) clicked FileDelete(1):
                use load_save_slot (number=1)
            hotspot (318, 326, 729, 134) clicked FileDelete(2):
                use load_save_slot (number=2)
            hotspot (318, 471, 732, 134) clicked FileDelete(3):
                use load_save_slot (number=3)

            

screen auto():

    # This ensures that any other menu screen is replaced.
    tag menu

    frame:
        # The buttons at the top allow the user to pick a
        # page of files.
        imagemap:
            ground "gui/SaveLoad/load_bg.png"
            idle "gui/Navigation/navmenu_idle.png"
            hover "gui/Navigation/navmenu_hover.png"
            selected_idle 'gui/Navigation/navmenu_selected_idle.png'
            selected_hover 'gui/Navigation/navmenu_selected_hover.png'
            
            alpha False
            # This is so that everything transparent is invisible to the cursor. 
            
            hotspot (30, 285, 238, 65) action Return()
            hotspot (30, 361, 239, 65) action ShowMenu("preferences")
            hotspot (30, 442, 238, 65) action ShowMenu("save")
            hotspot (30, 516, 238, 65) action ShowMenu("load")
            hotspot (30, 597, 238, 65) action MainMenu()

        imagemap:
            ground "gui/SaveLoad/saveload_idle.png"
            idle "gui/SaveLoad/saveload_idle.png"
            hover "gui/SaveLoad/saveload_hover.png"
            selected_idle "gui/SaveLoad/saveload_selected_idle.png"
            selected_hover "gui/SaveLoad/saveload_selected_hover.png"
            
            cache False
            alpha False
         
            hotspot (550, 87, 172, 57) action ShowMenu("delete")
            hotspot (774, 87, 173, 58) action ShowMenu("quick")
            hotspot (1005, 86, 170, 59) action ShowMenu("auto")
            
            hotspot (318, 178, 731, 134) clicked FileLoad(1, page = "auto"):
                use load_save_slot_auto (number=1)
            hotspot (318, 326, 729, 134) clicked FileLoad(2, page = "auto"):
                use load_save_slot_auto (number=2)
            hotspot (318, 471, 732, 134) clicked FileLoad(3, page = "auto"):
                use load_save_slot_auto (number=3)



screen quick():

    # This ensures that any other menu screen is replaced.
    tag menu

    frame:
        # The buttons at the top allow the user to pick a
        # page of files.
        imagemap:
            ground "gui/SaveLoad/load_bg.png"
            idle "gui/Navigation/navmenu_idle.png"
            hover "gui/Navigation/navmenu_hover.png"
            selected_idle 'gui/Navigation/navmenu_selected_idle.png'
            selected_hover 'gui/Navigation/navmenu_selected_hover.png'
            
            alpha False
            # This is so that everything transparent is invisible to the cursor. 
            
            hotspot (30, 285, 238, 65) action Return()
            hotspot (30, 361, 239, 65) action ShowMenu("preferences")
            hotspot (30, 442, 238, 65) action ShowMenu("save")
            hotspot (30, 516, 238, 65) action ShowMenu("load")
            hotspot (30, 597, 238, 65) action MainMenu()

        imagemap:
            ground "gui/SaveLoad/saveload_idle.png"
            idle "gui/SaveLoad/saveload_idle.png"
            hover "gui/SaveLoad/saveload_hover.png"
            selected_idle "gui/SaveLoad/saveload_selected_idle.png"
            selected_hover "gui/SaveLoad/saveload_selected_hover.png"
            
            cache False
            alpha False
         
            hotspot (550, 87, 172, 57) action ShowMenu("delete")
            hotspot (774, 87, 173, 58) action ShowMenu("quick")
            hotspot (1005, 86, 170, 59) action ShowMenu("auto")
            
            hotspot (318, 178, 731, 134) clicked FileLoad(1, page = "quick"):
                use load_save_slot_quick (number=1)
            hotspot (318, 326, 729, 134) clicked FileLoad(2, page = "quick"):
                use load_save_slot_quick (number=2)
            hotspot (318, 471, 732, 134) clicked FileLoad(3, page = "quick"):
                use load_save_slot_quick (number=3)




screen load_save_slot:
    $ last_phrase = FileJson(number, "last_line", empty=" ===== ", missing=" - ") # <-here
    $ animalrank = FileJson(number, "arankdisplay", empty=" ===== ", missing=" - ") # <-here
    $ file_text = "% 2s. %s\n%s\n%s" % (
                        FileSlotName(number, 3),
                        FileTime(number, empty=_("Empty Slot")),
                        FileSaveName(number),
                        last_phrase)

    add FileScreenshot(number) xpos 7 ypos 6
    text file_text xpos 230 ypos 15 size 20 color "#ffffff" outlines [ (2, "#302B54") ] kerning 2
    key "save_delete" action FileDelete(number)


screen load_save_slot_auto:
    $ last_phrase = FileJson(number, "last_line", empty=" ===== ", missing=" - ", page = "auto") # <-here
    $ animalrank = FileJson(number, "arankdisplay", empty=" ===== ", missing=" - ", page = "auto") # <-here
    $ file_text = "% 2s. %s\n%s\n%s" % (
                        FileSlotName(number, 3),
                        FileTime(number, empty=_("Empty Slot"), page = "auto"),
                        FileSaveName(number, page = "auto"),
                        last_phrase)

    add FileScreenshot(number, page = "auto") xpos 7 ypos 6
    text file_text xpos 230 ypos 15 size 20 color "#ffffff" outlines [ (2, "#302B54") ] kerning 2
    key "save_delete" action FileDelete(number, page = "auto")


screen load_save_slot_quick:
    $ last_phrase = FileJson(number, "last_line", empty=" ===== ", missing=" - ", page = "quick") # <-here
    $ animalrank = FileJson(number, "arankdisplay", empty=" ===== ", missing=" - ", page = "quick") # <-here
    $ file_text = "% 2s. %s\n%s\n%s" % (
                        FileSlotName(number, 3),
                        FileTime(number, empty=_("Empty Slot"), page = "quick"),
                        FileSaveName(number, page = "quick"),
                        last_phrase)

    add FileScreenshot(number, page = "quick") xpos 7 ypos 6
    text file_text xpos 230 ypos 15 size 20 color "#ffffff" outlines [ (2, "#302B54") ] kerning 2
    key "save_delete" action FileDelete(number, page = "quick")



init python:
    
    def the_lastline(d):
        mylast_line = store._last_say_what[:40]
        d["last_line"] = "%s%s%s" % ("\"", mylast_line, "...\"")
    
    config.save_json_callbacks.append(the_lastline)

init python:
    
    def arankdata(d):
        d["arankdisplay"] = arank
    
    config.save_json_callbacks.append(arankdata)



screen file_slots(title):

    default page_name_value = FilePageNameInputValue(pattern=_("Page {}"), auto=_("Automatic saves"), quick=_("Quick saves"))

    use game_menu(title):

        fixed:

            ## This ensures the input will get the enter event before any of the
            ## buttons do.
            order_reverse True

            ## The page name, which can be edited by clicking on a button.
            button:
                style "page_label"

                key_events True
                xalign 0.5
                action page_name_value.Toggle()

                input:
                    style "page_label_text"
                    value page_name_value

            ## The grid of file slots.
            grid gui.file_slot_cols gui.file_slot_rows:
                style_prefix "slot"

                xalign 0.5
                yalign 0.5

                spacing gui.slot_spacing

                for i in range(gui.file_slot_cols * gui.file_slot_rows):

                    $ slot = i + 1

                    button:
                        action FileAction(slot)

                        has vbox

                        add FileScreenshot(slot) xalign 0.5

                        text FileTime(slot, format=_("{#file_time}%A, %B %d %Y, %H:%M"), empty=_("empty slot")):
                            style "slot_time_text"

                        text FileSaveName(slot):
                            style "slot_name_text"

                        key "save_delete" action FileDelete(slot)

            ## Buttons to access other pages.
            hbox:
                style_prefix "page"

                xalign 0.5
                yalign 1.0

                spacing gui.page_spacing

                textbutton _("<") action FilePagePrevious()

                if config.has_autosave:
                    textbutton _("{#auto_page}A") action FilePage("auto")

                if config.has_quicksave:
                    textbutton _("{#quick_page}Q") action FilePage("quick")

                ## range(1, 10) gives the numbers from 1 to 9.
                for page in range(1, 10):
                    textbutton "[page]" action FilePage(page)

                textbutton _(">") action FilePageNext()


style page_label is gui_label
style page_label_text is gui_label_text
style page_button is gui_button
style page_button_text is gui_button_text

style slot_button is gui_button
style slot_button_text is gui_button_text
style slot_time_text is slot_button_text
style slot_name_text is slot_button_text

style page_label:
    xpadding 50
    ypadding 3

style page_label_text:
    text_align 0.5
    layout "subtitle"
    hover_color gui.hover_color

style page_button:
    properties gui.button_properties("page_button")

style page_button_text:
    properties gui.button_text_properties("page_button")

style slot_button:
    properties gui.button_properties("slot_button")

style slot_button_text:
    properties gui.button_text_properties("slot_button")


## Preferences screen ##########################################################
##
## The preferences screen allows the player to configure the game to better suit
## themselves.
##
## https://www.renpy.org/doc/html/screen_special.html#preferences

screen preferences():

    tag menu
    
    imagemap:
        ground "gui/Settings/settings_bg.png"
        idle "gui/Navigation/navmenu_idle.png"
        hover "gui/Navigation/navmenu_hover.png"
        selected_idle 'gui/Navigation/navmenu_selected_idle.png'
        selected_hover 'gui/Navigation/navmenu_selected_hover.png'
        
        alpha False
        # This is so that everything transparent is invisible to the cursor. 
        
        hotspot (30, 285, 238, 65) action Return()
        hotspot (30, 361, 239, 65) action ShowMenu("preferences")
        hotspot (30, 442, 238, 65) action ShowMenu("save")
        hotspot (30, 516, 238, 65) action ShowMenu("load")
        hotspot (30, 597, 238, 65) action MainMenu()

    
    imagemap:
        ground "gui/Settings/settings_idle.png"
        idle "gui/Settings/settings_idle.png"
        hover "gui/Settings/settings_hover.png"
        selected_idle "gui/Settings/settings_selected_idle.png" 
        selected_hover "gui/Settings/settings_selected_hover.png"
        
        alpha False
        
        hotspot (322, 273, 138, 19) action Preference("display", "fullscreen")
        hotspot (321, 302, 141, 18) action Preference("display", "window")
        hotspot (981, 299, 188, 23) action Preference("skip", "seen")
        hotspot (993, 269, 164, 25) action Preference("skip", "all")
        hotspot (558, 272, 104, 20) action Preference("transitions", "all")
        hotspot (555, 302, 109, 18) action Preference("transitions", "none")
        hotspot (748, 300, 168, 23) action Preference("after choices", "stop")
        hotspot (723, 270, 219, 25) action Preference("after choices", "skip")
        
        bar pos (760, 430) value Preference("text speed") style "pref_slider"
        #bar pos (332, 560) value Preference("sound volume") style "pref_slider"
        bar pos (332, 425) value Preference("music volume") style "pref_slider"
        bar pos (760, 560) value Preference("auto-forward time") style "pref_slider"
        
init -2 python:
    style.pref_slider.left_bar = "gui/Settings/empty.png"
    style.pref_slider.right_bar = "gui/Settings/full.png"

    style.pref_slider.xmaximum = 356
    style.pref_slider.ymaximum = 41

    style.pref_slider.thumb = "gui/Settings/thumb.png"
    style.pref_slider.thumb_offset = 18
    style.pref_slider.thumb_shadow = None


style pref_label is gui_label
style pref_label_text is gui_label_text
style pref_vbox is vbox

style radio_label is pref_label
style radio_label_text is pref_label_text
style radio_button is gui_button
style radio_button_text is gui_button_text
style radio_vbox is pref_vbox

style check_label is pref_label
style check_label_text is pref_label_text
style check_button is gui_button
style check_button_text is gui_button_text
style check_vbox is pref_vbox

style slider_label is pref_label
style slider_label_text is pref_label_text
style slider_slider is gui_slider
style slider_button is gui_button
style slider_button_text is gui_button_text
style slider_pref_vbox is pref_vbox

style mute_all_button is check_button
style mute_all_button_text is check_button_text

style pref_label:
    top_margin gui.pref_spacing
    bottom_margin 2

style pref_label_text:
    yalign 1.0

style pref_vbox:
    xsize 225

style radio_vbox:
    spacing gui.pref_button_spacing

style radio_button:
    properties gui.button_properties("radio_button")
    foreground "gui/button/check_[prefix_]foreground.png"

style radio_button_text:
    properties gui.button_text_properties("radio_button")

style check_vbox:
    spacing gui.pref_button_spacing

style check_button:
    properties gui.button_properties("check_button")
    foreground "gui/button/check_[prefix_]foreground.png"

style check_button_text:
    properties gui.button_text_properties("check_button")

style slider_slider:
    xsize 350

style slider_button:
    properties gui.button_properties("slider_button")
    yalign 0.5
    left_margin 10

style slider_button_text:
    properties gui.button_text_properties("slider_button")

style slider_vbox:
    xsize 450


## History screen ##############################################################
##
## This is a screen that displays the dialogue history to the player. While
## there isn't anything special about this screen, it does have to access the
## dialogue history stored in _history_list.
##
## https://www.renpy.org/doc/html/history.html

screen history():
    tag menu
    add "gui/History/pg_history.png"
    imagemap:
                hover "gui/History/history_idle.png"
                idle "gui/History/history_hover.png"
                
                alpha False
                # This is so that everything transparent is invisible to the cursor. 
                
                hotspot (1016, 632, 229, 74) action Return()

    predict False

    side "c":
        area (100, 100, 650, 400)
        
        viewport id "vp":
            scrollbars "vertical"
            draggable True
            mousewheel True
            arrowkeys True
            yinitial 1.0
            area (230, 70, 1800, 470)
            
            vbox:
                for h in _history_list:
                    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"]
                    frame background None bottom_margin 50: # add this line
                        text h.what outlines [ (1, "#000000", 0, 0), (0, "#000000", 2, 2) ]

                if not _history_list:
                    label _("The dialogue history is empty.")

## This determines what tags are allowed to be displayed on the history screen.

define gui.history_allow_tags = set()


style history_window is empty

style history_name is gui_label
style history_name_text is gui_label_text
style history_text is gui_text

style history_text is gui_text

style history_label is gui_label
style history_label_text is gui_label_text

style history_window:
    xfill True
    ysize gui.history_height

style history_name:
    xpos gui.history_name_xpos
    xanchor gui.history_name_xalign
    ypos gui.history_name_ypos
    xsize gui.history_name_width

style history_name_text:
    min_width gui.history_name_width
    text_align gui.history_name_xalign
    font "Kingthings_Petrock.ttf"
    size 40
    color "#2F5F83"
    #outlines [ (3, "#632F1F", 0, 0),  (2, "#FFE0A3", 0, 0), (1, "#FFD884", 0, 0) ]
    #outlines [ (1, "#632F1F", 0, 0), (0, "#632F1F", 2, 2) ]

style history_text:
    xpos gui.history_text_xpos
    ypos gui.history_text_ypos
    xanchor gui.history_text_xalign
    xsize gui.history_text_width
    min_width gui.history_text_width
    text_align gui.history_text_xalign
    layout ("subtitle" if gui.history_text_xalign else "tex")

style history_label:
    xfill True

style history_label_text:
    xalign 0.5


## Help screen #################################################################
##
## A screen that gives information about key and mouse bindings. It uses other
## screens (keyboard_help, mouse_help, and gamepad_help) to display the actual
## help.

screen help():

    tag menu

    default device = "keyboard"

    use game_menu(_("Help"), scroll="viewport"):

        style_prefix "help"

        vbox:
            spacing 15

            hbox:

                textbutton _("Keyboard") action SetScreenVariable("device", "keyboard")
                textbutton _("Mouse") action SetScreenVariable("device", "mouse")

                if GamepadExists():
                    textbutton _("Gamepad") action SetScreenVariable("device", "gamepad")

            if device == "keyboard":
                use keyboard_help
            elif device == "mouse":
                use mouse_help
            elif device == "gamepad":
                use gamepad_help


screen keyboard_help():

    hbox:
        label _("Enter")
        text _("Advances dialogue and activates the interface.")

    hbox:
        label _("Space")
        text _("Advances dialogue without selecting choices.")

    hbox:
        label _("Arrow Keys")
        text _("Navigate the interface.")

    hbox:
        label _("Escape")
        text _("Accesses the game menu.")

    hbox:
        label _("Ctrl")
        text _("Skips dialogue while held down.")

    hbox:
        label _("Tab")
        text _("Toggles dialogue skipping.")

    hbox:
        label _("Page Up")
        text _("Rolls back to earlier dialogue.")

    hbox:
        label _("Page Down")
        text _("Rolls forward to later dialogue.")

    hbox:
        label "H"
        text _("Hides the user interface.")

    hbox:
        label "S"
        text _("Takes a screenshot.")

    hbox:
        label "V"
        text _("Toggles assistive {a=https://www.renpy.org/l/voicing}self-voicing{/a}.")


screen mouse_help():

    hbox:
        label _("Left Click")
        text _("Advances dialogue and activates the interface.")

    hbox:
        label _("Middle Click")
        text _("Hides the user interface.")

    hbox:
        label _("Right Click")
        text _("Accesses the game menu.")

    hbox:
        label _("Mouse Wheel Up\nClick Rollback Side")
        text _("Rolls back to earlier dialogue.")

    hbox:
        label _("Mouse Wheel Down")
        text _("Rolls forward to later dialogue.")


screen gamepad_help():

    hbox:
        label _("Right Trigger\nA/Bottom Button")
        text _("Advances dialogue and activates the interface.")

    hbox:
        label _("Left Trigger\nLeft Shoulder")
        text _("Rolls back to earlier dialogue.")

    hbox:
        label _("Right Shoulder")
        text _("Rolls forward to later dialogue.")


    hbox:
        label _("D-Pad, Sticks")
        text _("Navigate the interface.")

    hbox:
        label _("Start, Guide")
        text _("Accesses the game menu.")

    hbox:
        label _("Y/Top Button")
        text _("Hides the user interface.")

    textbutton _("Calibrate") action GamepadCalibrate()


style help_button is gui_button
style help_button_text is gui_button_text
style help_label is gui_label
style help_label_text is gui_label_text
style help_text is gui_text

style help_button:
    properties gui.button_properties("help_button")
    xmargin 8

style help_button_text:
    properties gui.button_text_properties("help_button")

style help_label:
    xsize 250
    right_padding 20

style help_label_text:
    size gui.text_size
    xalign 1.0
    text_align 1.0



################################################################################
## Additional screens
################################################################################


## Confirm screen ##############################################################
##
## The confirm screen is called when Ren'Py wants to ask the player a yes or no
## question.
##
## https://www.renpy.org/doc/html/screen_special.html#confirm

screen confirm(message, yes_action, no_action):

    ## Ensure other screens do not get input while this screen is displayed.
    modal True

    imagemap:
        ground 'gui/YesNo/yesno_bg.png'
        idle 'gui/YesNo/yesno_idle.png'
        hover 'gui/YesNo/yesno_hover.png'
        
        hotspot (500, 451, 228, 75) action yes_action
        hotspot (768, 455, 228, 75) action no_action
                
    if message == layout.DELETE_SAVE:
        add "gui/YesNo/yesno_delete.png"
                    
    elif message == layout.OVERWRITE_SAVE:
        add "gui/YesNo/yesno_overwrite.png"
        
    elif message == layout.LOADING:
        add "gui/YesNo/yesno_load.png"
        
    elif message == layout.QUIT:
        add "gui/YesNo/yesno_quit.png"
        
    elif message == layout.MAIN_MENU:
        add "gui/YesNo/yesno_title.png"


## Skip indicator screen #######################################################
##
## The skip_indicator screen is displayed to indicate that skipping is in
## progress.
##
## https://www.renpy.org/doc/html/screen_special.html#skip-indicator

screen skip_indicator():
    add "gui/skip.png"


## Notify screen ###############################################################
##
## The notify screen is used to show the player a message. (For example, when
## the game is quicksaved or a screenshot has been taken.)
##
## https://www.renpy.org/doc/html/screen_special.html#notify-screen

screen notify(message):

    zorder 100
    style_prefix "notify"

    frame at notify_appear:
        text "[message!tq]"

    timer 3.25 action Hide('notify')


transform notify_appear:
    on show:
        alpha 0
        linear .25 alpha 1.0
    on hide:
        linear .5 alpha 0.0


style notify_frame is empty
style notify_text is gui_text

style notify_frame:
    ypos gui.notify_ypos

    background Frame("gui/notify.png", gui.notify_frame_borders, tile=gui.frame_tile)
    padding gui.notify_frame_borders.padding

style notify_text:
    properties gui.text_properties("notify")


## NVL screen ##################################################################
##
## This screen is used for NVL-mode dialogue and menus.
##
## https://www.renpy.org/doc/html/screen_special.html#nvl


screen nvl(dialogue, items=None):

    window:
        style "nvl_window"

        has vbox:
            spacing gui.nvl_spacing

        ## Displays dialogue in either a vpgrid or the vbox.
        if gui.nvl_height:

            vpgrid:
                cols 1
                yinitial 1.0

                use nvl_dialogue(dialogue)

        else:

            use nvl_dialogue(dialogue)

        ## Displays the menu, if given. The menu may be displayed incorrectly if
        ## config.narrator_menu is set to True, as it is above.
        for i in items:

            textbutton i.caption:
                action i.action
                style "nvl_button"

    add SideImage() xalign 0.0 yalign 1.0


screen nvl_dialogue(dialogue):

    for d in dialogue:

        window:
            id d.window_id

            fixed:
                yfit gui.nvl_height is None

                if d.who is not None:

                    text d.who:
                        id d.who_id

                text d.what:
                    id d.what_id


## This controls the maximum number of NVL-mode entries that can be displayed at
## once.
define config.nvl_list_length = gui.nvl_list_length

style nvl_window is default
style nvl_entry is default

style nvl_label is say_label
style nvl_dialogue is say_dialogue

style nvl_button is button
style nvl_button_text is button_text

style nvl_window:
    xfill True
    yfill True

    background "gui/nvl.png"
    padding gui.nvl_borders.padding

style nvl_entry:
    xfill True
    ysize gui.nvl_height

style nvl_label:
    xpos gui.nvl_name_xpos
    xanchor gui.nvl_name_xalign
    ypos gui.nvl_name_ypos
    yanchor 0.0
    xsize gui.nvl_name_width
    min_width gui.nvl_name_width
    text_align gui.nvl_name_xalign

style nvl_dialogue:
    xpos gui.nvl_text_xpos
    xanchor gui.nvl_text_xalign
    ypos gui.nvl_text_ypos
    xsize gui.nvl_text_width
    min_width gui.nvl_text_width
    text_align gui.nvl_text_xalign
    layout ("subtitle" if gui.nvl_text_xalign else "tex")

style nvl_thought:
    xpos gui.nvl_thought_xpos
    xanchor gui.nvl_thought_xalign
    ypos gui.nvl_thought_ypos
    xsize gui.nvl_thought_width
    min_width gui.nvl_thought_width
    text_align gui.nvl_thought_xalign
    layout ("subtitle" if gui.nvl_text_xalign else "tex")

style nvl_button:
    properties gui.button_properties("nvl_button")
    xpos gui.nvl_button_xpos
    xanchor gui.nvl_button_xalign

style nvl_button_text:
    properties gui.button_text_properties("nvl_button")



################################################################################
## Mobile Variants
################################################################################

style pref_vbox:
    variant "medium"
    xsize 450

## Since a mouse may not be present, we replace the quick menu with a version
## that uses fewer and bigger buttons that are easier to touch.
screen quick_menu():
    variant "touch"

    zorder 100

    hbox:
        style_prefix "quick"

        xalign 0.5
        yalign 1.0

        textbutton _("Back") action Rollback()
        textbutton _("Skip") action Skip() alternate Skip(fast=True, confirm=True)
        textbutton _("Auto") action Preference("auto-forward", "toggle")
        textbutton _("Menu") action ShowMenu()


style window:
    variant "small"
    background "gui/phone/textbox.png"

style radio_button:
    variant "small"
    foreground "gui/phone/button/check_[prefix_]foreground.png"

style check_button:
    variant "small"
    foreground "gui/phone/button/check_[prefix_]foreground.png"

style nvl_window:
    variant "small"
    background "gui/phone/nvl.png"

style main_menu_frame:
    variant "small"
    background "gui/phone/overlay/main_menu.png"

style game_menu_outer_frame:
    variant "small"
    background "gui/phone/overlay/game_menu.png"

style game_menu_navigation_frame:
    variant "small"
    xsize 340

style game_menu_content_frame:
    variant "small"
    top_margin 0

style pref_vbox:
    variant "small"
    xsize 400

style bar:
    variant "small"
    ysize gui.bar_size
    left_bar Frame("gui/phone/bar/left.png", gui.bar_borders, tile=gui.bar_tile)
    right_bar Frame("gui/phone/bar/right.png", gui.bar_borders, tile=gui.bar_tile)

style vbar:
    variant "small"
    xsize gui.bar_size
    top_bar Frame("gui/phone/bar/top.png", gui.vbar_borders, tile=gui.bar_tile)
    bottom_bar Frame("gui/phone/bar/bottom.png", gui.vbar_borders, tile=gui.bar_tile)

style scrollbar:
    variant "small"
    ysize gui.scrollbar_size
    base_bar Frame("gui/phone/scrollbar/horizontal_[prefix_]bar.png", gui.scrollbar_borders, tile=gui.scrollbar_tile)
    thumb Frame("gui/phone/scrollbar/horizontal_[prefix_]thumb.png", gui.scrollbar_borders, tile=gui.scrollbar_tile)

style vscrollbar:
    variant "small"
    xsize gui.scrollbar_size
    base_bar Frame("gui/phone/scrollbar/vertical_[prefix_]bar.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile)
    thumb Frame("gui/phone/scrollbar/vertical_[prefix_]thumb.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile)

style slider:
    variant "small"
    ysize gui.slider_size
    base_bar Frame("gui/phone/slider/horizontal_[prefix_]bar.png", gui.slider_borders, tile=gui.slider_tile)
    thumb "gui/phone/slider/horizontal_[prefix_]thumb.png"

style vslider:
    variant "small"
    xsize gui.slider_size
    base_bar Frame("gui/phone/slider/vertical_[prefix_]bar.png", gui.vslider_borders, tile=gui.slider_tile)
    thumb "gui/phone/slider/vertical_[prefix_]thumb.png"

style slider_pref_vbox:
    variant "small"
    xsize None

style slider_pref_slider:
    variant "small"
    xsize 600





Maou Zenigame
Regular
Posts: 66
Joined: Thu Nov 09, 2017 3:09 am
Contact:

Re: Namebox suddenly broke

#6 Post by Maou Zenigame » Sun Jan 12, 2020 5:33 am

Did some testing and apparently it has something to do with choosing DirectX software rendering while using a computer running Windows 7.
Still have no idea how to make it stop doing this while in that mode, though.

Post Reply

Who is online

Users browsing this forum: span4ev