Shadow overlapping problem on scroll 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: 58
Joined: Sat Jul 09, 2022 1:39 pm
Contact:

Shadow overlapping problem on scroll bar

#1 Post by yoyuchi » Fri Jul 22, 2022 5:27 am

Hello, everyone
I replaced default scroll bar with a custom bar.

emptybar.jpg
emptybar.jpg (11.3 KiB) Viewed 233 times
fullbar.jpg
fullbar.jpg (12.65 KiB) Viewed 233 times
fullbar_hover.jpg
fullbar_hover.jpg (12.51 KiB) Viewed 233 times

Use this scroll bar, it appears a black piece at the bottom of the bar as shown below.
1.jpg

It seems to be caused by overlapping the bottom shadows of the scrollbar image. How can I get remove this piece?
Maybe it's the click highlight range of the mouse...
When the mouse is clicked on the bar, Can the end of the mouse pointer match the edge of bar ?

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3636
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Shadow overlapping problem on scroll bar

#2 Post by Imperf3kt » Fri Jul 22, 2022 5:36 am

edit your thumb.png file to remove the shadow
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

yoyuchi
Regular
Posts: 58
Joined: Sat Jul 09, 2022 1:39 pm
Contact:

Re: Shadow overlapping problem on scroll bar

#3 Post by yoyuchi » Fri Jul 22, 2022 10:10 am

Imperf3kt wrote:
Fri Jul 22, 2022 5:36 am
edit your thumb.png file to remove the shadow
Thanks for the advice.
Here is my preference script.

Code: Select all

           vbox:
                style_group "prefs"
                vbox:              
                    bar value Preference("music volume") 
                    pos(10, 117)
                    
                vbox:
                    bar value Preference("voice volume") 
                    pos(10, 180)

                vbox:
                    bar value Preference("sound volume") 
                    pos(10, 248)
              
                vbox:
                    bar value FieldValue(persistent, "dialogueBoxOpacity", range=1.0, style="slider")
                    pos(10, 310)          

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 = .1

    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 

Thumb for bar adjustment is not used.
It was only used three images, emptybar, fullbar, and fullbar_hover.
How do you mean to modify the thumb?

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Shadow overlapping problem on scroll bar

#4 Post by Alex » Fri Jul 22, 2022 1:36 pm

yoyuchi wrote:
Fri Jul 22, 2022 10:10 am
...
Try to add

Code: Select all

style.prefs_slider.thumb_shadow = None
https://www.renpy.org/doc/html/style_pr ... umb_shadow

yoyuchi
Regular
Posts: 58
Joined: Sat Jul 09, 2022 1:39 pm
Contact:

Re: Shadow overlapping problem on scroll bar

#5 Post by yoyuchi » Sat Jul 23, 2022 12:40 am

Alex wrote:
Fri Jul 22, 2022 1:36 pm
yoyuchi wrote:
Fri Jul 22, 2022 10:10 am
...
Try to add

Code: Select all

style.prefs_slider.thumb_shadow = None
https://www.renpy.org/doc/html/style_pr ... umb_shadow
Thank you, but the problem is not solved.
It seems not a matter of thumb.
The shadows at the bottom of the scrollbar image seem to overlap.
Can't I adjust the section where each scroll bar image overlaps? Is there a way?

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Shadow overlapping problem on scroll bar

#6 Post by Alex » Sat Jul 23, 2022 1:47 am

yoyuchi wrote:
Sat Jul 23, 2022 12:40 am
...The shadows at the bottom of the scrollbar image seem to overlap.
Can't I adjust the section where each scroll bar image overlaps? Is there a way?
Well, then try to play with 'thumb_offset' (next property in the link above).

yoyuchi
Regular
Posts: 58
Joined: Sat Jul 09, 2022 1:39 pm
Contact:

Re: Shadow overlapping problem on scroll bar

#7 Post by yoyuchi » Sat Jul 23, 2022 1:54 am

Alex wrote:
Sat Jul 23, 2022 1:47 am
yoyuchi wrote:
Sat Jul 23, 2022 12:40 am
...The shadows at the bottom of the scrollbar image seem to overlap.
Can't I adjust the section where each scroll bar image overlaps? Is there a way?
Well, then try to play with 'thumb_offset' (next property in the link above).
style.prefs_slider.thumb_offset = 0

This phrase resolved the situation.
Thank you so much for your help!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], minyan