Adjusting the Thumbnail Position on the Slider Bar

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
yoyuchi
Regular
Posts: 49
Joined: Sat Jul 09, 2022 1:39 pm
Contact:

Adjusting the Thumbnail Position on the Slider Bar

#1 Post by yoyuchi » Sun Aug 14, 2022 5:01 am

Hello, everyone.
I use the slide bar for volume control etc. in the preferences.
The right arrow on the keyboard seems to move a few more spaces even after making the volume maximum.
Maximize the volume, press the right arrow a few more times, and then press the left arrow to make the slide bar shrink, but bar is not moving, and press it a couple more times, then it begins to shrink.
If slide bar is maxed out, the slide bar must be shrink immediately when the left arrow is pressed once.
I8478.jpg
I8478.jpg (7.72 KiB) Viewed 233 times
When I checked with the thumbnail, the thumbnail is off the slide bar.
What can I add to match this thumbnail with max on the slide bar?
I think we can add some properties, but I don't know what it is.

Code: Select all

                vbox:                 
                    bar value Preference("voice volume") 
                    pos(10, 180)

Code: Select all

style quick_button_text size 18
style quick_window left_padding 2
style quick_window right_padding 2
style gm_root background 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 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 570
    


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 50

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

init python:
    style.prefs_slider.right_bar = "gui/bar/emptybar.png" 
    style.prefs_slider.hover_right_bar = 'gui/bar/emptybar_hover.png' 
    style.prefs_slider.left_bar = 'gui/bar/fullbar.png' 
    style.prefs_slider.hover_left_bar = 'gui/bar/fullbar_hover.png' 
    style.prefs_slider.thumb = None 
    style.prefs_slider.xminimum = 0    
    style.prefs_slider.thumb_shadow = None
    style.prefs_slider.thumb_offset = 0    

    style.prefs_window.background = Frame("window.png", 15, 15) 
    style.prefs_window.align = (0, 0) 
    style.prefs_window.pos = (25, 30) 
    style.prefs_window.xmaximum = 400 
    style.prefs_window.ymaximum = 580 
    style.prefs_window.xpadding = 1
    style.prefs_window.ypadding = 1 
Any advice will be of great help.

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1843
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Adjusting the Thumbnail Position on the Slider Bar

#2 Post by Ocelot » Sun Aug 14, 2022 5:38 am

What is the image you ae using for bars? The entire image is used for bar, so if you have empty space to the right of where you think bar should end, then it doesn't end there, it continues to the end of the image even if there are no non-transparent pixels there. You can cut your image or play around with left/right_gutter style properties.
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: Google [Bot]