(solved)how do i make a bar glow while hovered

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
SONTSE
Regular
Posts: 96
Joined: Sun Nov 24, 2013 10:49 pm
Completed: 11 VN's so far
Discord: jkx0282_10798
Contact:

(solved)how do i make a bar glow while hovered

#1 Post by SONTSE »

When a bar evaluates Preferences values, it has a thumb and glows (gets lighter color) while hovered,
but when there is custom variable instead -- it gets more simple, with no thumb, and doesn't glow while hovered,
and i want it to look the same. how do i do this? how do i control colors of my bar?
docs were kinda unclear to this issue (of maybe it's just me)
Thanks
Last edited by SONTSE on Sat Jan 26, 2019 4:29 pm, edited 1 time in total.

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: how do i make a bar glow while hovered

#2 Post by rayminator »

can you post your code so we can help better

User avatar
SONTSE
Regular
Posts: 96
Joined: Sun Nov 24, 2013 10:49 pm
Completed: 11 VN's so far
Discord: jkx0282_10798
Contact:

Re: how do i make a bar glow while hovered

#3 Post by SONTSE »

rayminator wrote: Sat Jan 26, 2019 12:31 pm can you post your code so we can help better

Code: Select all

default persistent.custom_value = .8

screen these_bars_have_to_be_identical:
    frame:
        margin(5,5)
        padding(5,5)
        xsize 300
        ysize 300
        align (.5,.5)
        has vbox
        text 'Lower bar has to be same as upper bar'
        null height 10
        text 'The upper bar'
        bar value Preference('music volume')
        null height 10
        text 'The lower bar'
        bar value FieldValue(persistent,'custom_value',1.0,step=.01)


label main_menu:
    return
label start:
    call screen these_bars_have_to_be_identical
    return


User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: how do i make a bar glow while hovered

#4 Post by IrinaLazareva »

try to replace

Code: Select all

        bar value FieldValue(persistent,'custom_value',1.0,step=.01)
to

Code: Select all

        bar value FieldValue(persistent,'custom_value',1.0,step=.01) style 'pref_slider'

User avatar
SONTSE
Regular
Posts: 96
Joined: Sun Nov 24, 2013 10:49 pm
Completed: 11 VN's so far
Discord: jkx0282_10798
Contact:

Re: how do i make a bar glow while hovered

#5 Post by SONTSE »

IrinaLazareva wrote: Sat Jan 26, 2019 4:08 pm try to replace

Code: Select all

        bar value FieldValue(persistent,'custom_value',1.0,step=.01)
to

Code: Select all

        bar value FieldValue(persistent,'custom_value',1.0,step=.01) style 'pref_slider'
Yep, that's work. Thank you, IrinaLazareva!

Post Reply

Who is online

Users browsing this forum: Sugar_and_rice