Styling vertical bars for Prefs screen...[SOLVED! :D]

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
Duskylli
Regular
Posts: 175
Joined: Wed Mar 27, 2013 12:48 pm
Completed: The Mishka Effect, Fairly Dangerous.
Projects: Palette Swap
Contact:

Styling vertical bars for Prefs screen...[SOLVED! :D]

#1 Post by Duskylli »

I'm trying to style the 'Music Volume', 'Sound Volume,' 'Text speed' and 'Auto Forward Time' bars vertically for the Prefs screen using Leon and Uncle Mugen's image button tutorial. The graphic for the bars and thumb appears fine when I use horizontal bars. But when I try to style it vertically the clock graphic and mouse disappears and the options don't work properly.

Code: Select all

 frame xpos 493 ypos 380:
        style_group "pref"
        has vbox
        vbar value Preference("music volume")
    frame xpos 647 ypos 380:
        style_group "pref"
        has vbox
        vbar value Preference("sound volume")
    frame xpos 806 ypos 380:
        style_group "pref"
        has vbox
        vbar value Preference("text speed")
    frame xpos 972 ypos 380:
        style_group "pref"
        has vbox
        vbar value Preference("auto-forward time")
      
init -2 python:
    # Styling for the bar sliders:
    # Aleema's Customizing Menus tutorial: http://lemmasoft.renai.us/forums/viewtopic.php?f=51&t=9812
    # Bar style properties documentation: http://www.renpy.org/doc/html/style.html#bar-style-properties
    style.pref_frame.background = None
    style.pref_slider.top_bar = "gui/config_vbar_full.png"
    style.pref_slider.bottom_bar = "gui/config_vbar_empty.png"
    style.pref_slider.thumb = None
    style.pref_slider.xmaximum = 72
    style.pref_slider.ymaximum = 263    
    style.pref_slider.thumb = "gui/thumb.png"
    style.pref_slider.thumb_offset = 20
    style.pref_slider.thumb_shadow = None
Attachments
The graphic dissapears.
The graphic dissapears.
In game regular bars.png
Last edited by Duskylli on Tue Apr 01, 2014 12:46 am, edited 1 time in total.

User avatar
feathersnake
Regular
Posts: 104
Joined: Fri Apr 13, 2012 8:05 pm
Completed: A Rose by Any Other Name
Projects: Color, You've Got Mail!
Organization: Olfix Productions
Tumblr: olfix
Deviantart: olfix
Contact:

Re: Styling vertical bars for Prefs screen...

#2 Post by feathersnake »

I remember having issues with that myself. Here's what I had for Rose's sliders after init -2 python:

Code: Select all

    style.pref_frame.background = None
    style.pref_slider.bar_vertical = True
    style.pref_slider.bar_invert = False
    style.pref_slider.bottom_bar = "Gui/Rose_Prefs_Thermfull.png"
    style.pref_slider.top_bar = "Gui/Rose_Prefs_Thermempty.png"
    style.pref_slider.thumb = None
    style.pref_slider.xmaximum = 30
    style.pref_slider.ymaximum = 148
Naturally, your x and y maximum values are different. :P
Also, in your code I noticed that you have "style.pref_slider.thumb" defined as None once and then again with an image.
Olfix Productions:
Tumblr | itch.io
Complete Projects:
A Rose by Any Other Name
In-progress:
Color | You've Got Mail!

User avatar
Duskylli
Regular
Posts: 175
Joined: Wed Mar 27, 2013 12:48 pm
Completed: The Mishka Effect, Fairly Dangerous.
Projects: Palette Swap
Contact:

Re: Styling vertical bars for Prefs screen...

#3 Post by Duskylli »

Hey feathersnake! Oops the thumbs still work though xD

Ok I added some code but its still not working:

Code: Select all

init -2 python:
    style.pref_frame.background = None
    style.pref_slider.bar_vertical = True
    style.pref_slider.bar_invert =False
    style.pref_slider.bottom_bar = "gui/config_vbar_empty.png"
    style.pref_slider.top_bar = "gui/config_vbar_full.png"
    style.pref_slider.xmaximum = 72
    style.pref_slider.ymaximum = 263    
    style.pref_slider.thumb = "gui/thumb.png"
    style.pref_slider.thumb_offset = 20
    style.pref_slider.thumb_shadow = None
My x and y maximum are the exact size of the config bar graphic.

User avatar
feathersnake
Regular
Posts: 104
Joined: Fri Apr 13, 2012 8:05 pm
Completed: A Rose by Any Other Name
Projects: Color, You've Got Mail!
Organization: Olfix Productions
Tumblr: olfix
Deviantart: olfix
Contact:

Re: Styling vertical bars for Prefs screen...

#4 Post by feathersnake »

Hello. :3

Ah, I tried imitating a piece of your code that was different than mine to see if I could get a similar issue, and I think I found it. Instead of "vbar" in the values of your first chunk of code, try taking out the "v" so it's just "bar value" for each.
Olfix Productions:
Tumblr | itch.io
Complete Projects:
A Rose by Any Other Name
In-progress:
Color | You've Got Mail!

User avatar
Duskylli
Regular
Posts: 175
Joined: Wed Mar 27, 2013 12:48 pm
Completed: The Mishka Effect, Fairly Dangerous.
Projects: Palette Swap
Contact:

Re: Styling vertical bars for Prefs screen...

#5 Post by Duskylli »

Its working perfectly now!!! Thanks so much for your help Feather!!!!!!
Attachments
Mouse.png

User avatar
feathersnake
Regular
Posts: 104
Joined: Fri Apr 13, 2012 8:05 pm
Completed: A Rose by Any Other Name
Projects: Color, You've Got Mail!
Organization: Olfix Productions
Tumblr: olfix
Deviantart: olfix
Contact:

Re: Styling vertical bars for Prefs screen...[SOLVED! :D]

#6 Post by feathersnake »

You're very welcome! ^^ I'm glad you got it working.
This is for NaNo right? Good luck to you guys on finishing up~ The GUI looks great!
Olfix Productions:
Tumblr | itch.io
Complete Projects:
A Rose by Any Other Name
In-progress:
Color | You've Got Mail!

User avatar
Duskylli
Regular
Posts: 175
Joined: Wed Mar 27, 2013 12:48 pm
Completed: The Mishka Effect, Fairly Dangerous.
Projects: Palette Swap
Contact:

Re: Styling vertical bars for Prefs screen...[SOLVED! :D]

#7 Post by Duskylli »

Yep its for the our Nano game 'The Mishka Effect.' Thanks!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], Sugar_and_rice