[SOLVED] Customizing the volume slider

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
Exodus13
Newbie
Posts: 9
Joined: Fri May 13, 2022 9:47 am
Projects: Reanimated Heart
Organization: None
IRC Nick: Exodus
Github: Exodus13
Discord: purgatio
Contact:

[SOLVED] Customizing the volume slider

#1 Post by Exodus13 »

So I wanted to change the width and length of the sliders in user preferences, but I'm not sure how to do that in a way that it doesn't change the sliders in other menus. Basically I want the options menu to look different depending on where you access it from (quick menu or main menu).
Last edited by Exodus13 on Mon May 08, 2023 6:52 pm, edited 1 time in total.

User avatar
_ticlock_
Miko-Class Veteran
Posts: 910
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: Customizing the volume slider

#2 Post by _ticlock_ »

Exodus13 wrote: Sun Nov 27, 2022 5:29 am So I wanted to change the width and length of the sliders in user preferences, but I'm not sure how to do that in a way that it doesn't change the sliders in other menus.
You can apply different styles to the sliders, or specify some parameters to overwrite currently used style:

Code: Select all

bar value Preference("music volume"):
    style "some_new_style"

Code: Select all

bar value Preference("music volume"):
    xysize 100,5
Exodus13 wrote: Sun Nov 27, 2022 5:29 am Basically I want the options menu to look different depending on where you access it from (quick menu or main menu).
There are two ways:
1) you define two screens (for example, preferences and preferences2) and use action ShowMenu('preferences') from the game_menu and ShowMenu('preferences2') from the quick menu
2) You may pass argument to the screen to distinguish what style you want to use for example:

Code: Select all

... ShowMenu('preferences', from_quick_menu = True)

Code: Select all

screen preferences( from_quick_menu = False):
    tag menu
    ...
    bar value Preference("music volume"):
        if from_quick_menu:
            xysize 100,5

Post Reply

Who is online

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