Issues with Bar Customization

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
Yuna109
Newbie
Posts: 1
Joined: Tue Aug 28, 2018 10:28 pm
Deviantart: Yuna109
Soundcloud: Yuna-109
Contact:

Issues with Bar Customization

#1 Post by Yuna109 »

So, I'm trying to do an affection/love points screen using bars. The only problem I'm having is that my customized style for the bars is not showing. Instead of using the images, it sticks to the default Ren'Py theme.
In the preferences screen, though, they show up just fine.

Here is the code from the preferences screen.

Code: Select all

style pref_slider:
        left_bar "icons/bar_full.png"
        right_bar "icons/bar_empty.png"
        hover_left_bar "icons/bar_hover.png"
        ymaximum 30
        xmaximum 192
        xalign 1.0
        
        thumb "icons/thumb.png"
        thumb_shadow None
        thumb_offset 15
Here is the code I'm using for the whole affection screen.

Code: Select all

screen aff_screen:
    frame:
        style_group "affs"
        
        area (0, 0.15, 1260, 520)
        
        xpos 0.25
        xmargin .05
        ymargin .05
        yanchor 0
        ypadding .05
        
        has vbox:
            xalign .5
            yalign .5
            spacing 30

        hbox:
            label "Darren: " xminimum 100
            bar  range darren_max value darren_points xmaximum 400

        hbox:
            label "Filmore: " xminimum 100
            bar range filmore_max value filmore_points xmaximum 400
            
        hbox:
            label "Hayden: " xminimum 100
            bar range hayden_max value hayden_points xmaximum 400
        hbox:
            label "Vincent: " xminimum 100
            bar range vincent_max value vincent_points xmaximum 400
        textbutton "Return" action Return()
        
label aff_screen_label:
    call screen aff_screen
    return
    
init -2:
    style affs_frame:
        background Frame("icons/frame.png",10,10)
        xfill True
        xmargin 5
        top_margin 5
        
    style affs_label:
        xpos 0.5
        xanchor "center"
        
    style affs_label_text:
        color "#fff"
        size 26
        font"fonts/TCM.ttf"
        outlines [(2, "#000", 0, 0)]
        hover_outlines [(2, "#666", 0, 0)]

    ##Bars don't work yet.
    style affs_slider:
        left_bar "icons/bar_full.png"
        right_bar "icons/bar_empty.png"
        hover_left_bar "icons/bar_full.png"
        ymaximum 30
        xmaximum 190
        
    style affs_button:
        idle_background Frame("icons/button_idle.png",10,10)
        hover_background Frame("icons/button_hover.png",10,10)
        
    style affs_button_text:
        color "#fff"
        size 16
        font"fonts/TCM.ttf"
        outlines [(2, "#000", 0, 0)]
        hover_outlines [(2, "#666", 0, 0)]
        selected_outlines [(2, "#000", 0, 0)]
Any ideas why this could be happening? I'm a beginner at coding, so it might be something kind of obvious that I'm not noticing.

Post Reply

Who is online

Users browsing this forum: simba975