Preferences Slider not working right

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
Bryy
Veteran
Posts: 407
Joined: Thu Dec 20, 2012 10:12 pm
Completed: 30+ games so far
Projects: Furry Shakespeare
Organization: Stegalosaurus Game Development
Location: Portage, MI
Contact:

Preferences Slider not working right

#1 Post by Bryy »

So, this is probably something I knew how to do but forgot, but I'm at the end of my rope so I'll ask the forums.

So, wherever I click and drag my cursor on the preferences page, my Music bar also slides up and down.

This is my prefs code:

Code: Select all

screen preferences():
    tag menu
    add "gui/prefs_bg.png"
    frame:
        $ui.imagebutton ("gui/ui_pref/SET_Fullscreen.png", xpos=700, ypos=100, action=Preference('display', 'fullscreen'))
        $ui.imagebutton ("gui/ui_pref/SET_Windowed.png", xpos=648, ypos=200, action=Preference('display', 'window'))
    frame:
        $ui.imagebutton ("gui/ui_pref/SET_Music.png", xpos=648, ypos=400)
    frame:
        $ui.imagebutton ("gui/ui_pref/SET_Return.png", xpos=700, ypos=750, clicked=Return())
    frame xpos 648 ypos 520:
        style_group "pref"
        has vbox
        bar value Preference("music volume")

init -2 python:
    style.pref_frame.background = None
    style.pref_slider.left_bar = "gui/ui_pref/SET_BarMusic2.png"
    style.pref_slider.right_bar = "gui/ui_pref/SET_BarMusic.png"
    #style.pref_slider.thumb = "gui/SET_Slider.png"
    style.pref_slider.ymaximum = 750
    style.pref_slider.xmaximum = 600

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

Re: Preferences Slider not working right

#2 Post by Imperf3kt »

The code youre using is ancient, you should consider updating it to the code available in the documentation.
ui elements are deprecated and only for internal use.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Google [Bot], Ocelot