[Solved] Mystery of the Invisible Hotbar

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
Gear
Miko-Class Veteran
Posts: 764
Joined: Tue Apr 05, 2011 10:15 pm
Projects: Tempestus Sum
Organization: Xenokos Interactive
IRC Nick: Gear
Skype: Skye.Gear
Location: Grand Prairie, TX
Contact:

[Solved] Mystery of the Invisible Hotbar

#1 Post by Gear » Thu Mar 20, 2014 9:56 pm

So my options screen has a hotbar for altering the volume of the sound effects, voice effects, text speed, and music. The hotbar works, so if you click and slide, the volume is affected. The problem is, the hotbar won't appear on the screen, so it's effectively invisible.
screenshot0017.png
Seriously, it's like an old TV. How did people live before we had on-screen volume displays?
Anyway, I can't for the life of me get the code to work. I didn't write it initially, but the person who did has vanished from the Internet, so I turn to you, more programmically-inclined individuals, to assist me. All I can say is that the images are exactly where the program is looking for them. Or at least it seems so. The code is as follows:

Code: Select all

imagemap:
        ground "ui/options/ground.png"
        idle "ui/options/idle.png"
        hover "ui/options/hover.png"
        selected_idle "ui/options/hover.png"
        selected_hover "ui/options/hover.png"
        
        hotspot (628,152,180,20) clicked Preference("display", "window")
        hotspot (621,181,195,21) clicked Preference ("display", "fullscreen")
        hotspot (1017,152,83,19) clicked Preference("transitions", "all")
        hotspot (1006,182,104,18) clicked Preference("transitions", "none")
        
        hotspot (613,313,225,20) action Preference('skip', 'seen')
        hotspot (624,343,202,19) action Preference('skip', 'all')
        hotspot (604,400,244,20) action Preference('skip', 'begin')
        hotspot (940,311,232,23) action Preference('skip', 'stop')
        hotspot (941,341,227,22) action Preference('skip', 'keep')
        #(725, 181, 790, 213, "Sound Test"),

        hotbar (278,161,266,21) value Preference("music volume")
        hotbar (278,222,266,21) value Preference("sound volume")
        hotbar (278,282,266,21) value Preference("voice volume")
        hotbar (278,342,266,21) value Preference("text speed")

        # Also define the game menu buttons.
        hotspot (42,615,164,23) action Return()
        hotspot (414,615,222,23) action ShowMenu('save')
        hotspot (645,615,223,23) action ShowMenu('load')
        hotspot (214,615,192,23) action ShowMenu('preferences')
        hotspot (877,615,223,23) action MainMenu()
        hotspot (1108,615,118,23) action Quit()
        
init -2 python:
    style.pref_slider.left_bar = "ui/options/full_bar.png"
    style.pref_slider.right_bar = "ui/options/empty_bar.png"   
    style.pref_slider.xmaximum = 221
    style.pref_slider.ymaximum = 15       
    style.pref_slider.thumb_offset = 0
    style.pref_slider.left_gutter = 0
    style.pref_slider.right_gutter = 0
    style.pref_slider.thumb_shadow = None
Any help would be appreciated.
Last edited by Gear on Fri Mar 21, 2014 12:58 am, edited 1 time in total.
The best reason to get up in the morning is to outdo yourself: to do it better than you've ever done it before. But if you haven't done it better by nightfall... look at your globe and pick a spot: it's always morning somewhere.

User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Professor Layton and the Mystery of the Invisible Hotbar

#2 Post by Asceai » Thu Mar 20, 2014 10:15 pm

I'm pretty confused by this.
You have all these style.pref_slider lines, but you don't have any bars (hotbars use the imagemap images like hotspots) and you don't have anything that uses the pref_slider style or the pref style group.
There's nothing wrong with your hotbars as far as I can tell. Did you actually draw the hotbars onto your imagemap images? If you did, post the pics. If you didn't, that's the problem.

User avatar
Gear
Miko-Class Veteran
Posts: 764
Joined: Tue Apr 05, 2011 10:15 pm
Projects: Tempestus Sum
Organization: Xenokos Interactive
IRC Nick: Gear
Skype: Skye.Gear
Location: Grand Prairie, TX
Contact:

Re: Professor Layton and the Mystery of the Invisible Hotbar

#3 Post by Gear » Thu Mar 20, 2014 11:33 pm

No...when the UI was sent to me, it had the hotbars as separate images, not built into the background image, if I understand your question correctly. Which bar goes in the image? The full, or empty?
full_bar.png
full_bar.png (3.01 KiB) Viewed 600 times
empty_bar.png
empty_bar.png (3.01 KiB) Viewed 600 times
The best reason to get up in the morning is to outdo yourself: to do it better than you've ever done it before. But if you haven't done it better by nightfall... look at your globe and pick a spot: it's always morning somewhere.

User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Professor Layton and the Mystery of the Invisible Hotbar

#4 Post by Asceai » Thu Mar 20, 2014 11:40 pm

Both. I don't know which imagemap images they go into respectively though; I've never used hotbars. Try putting e.g. different colours in each of those imagemap images in the area defined covered by one of the hotbars so you can tell.

User avatar
Gear
Miko-Class Veteran
Posts: 764
Joined: Tue Apr 05, 2011 10:15 pm
Projects: Tempestus Sum
Organization: Xenokos Interactive
IRC Nick: Gear
Skype: Skye.Gear
Location: Grand Prairie, TX
Contact:

Re: Professor Layton and the Mystery of the Invisible Hotbar

#5 Post by Gear » Fri Mar 21, 2014 12:12 am

It works on the ground and idle images, but the hover screws up. How do you set it up for hover?
The best reason to get up in the morning is to outdo yourself: to do it better than you've ever done it before. But if you haven't done it better by nightfall... look at your globe and pick a spot: it's always morning somewhere.

User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Professor Layton and the Mystery of the Invisible Hotbar

#6 Post by Asceai » Fri Mar 21, 2014 12:14 am

The problem could be that you're using the same images for hover, selected_idle and selected_hover:

Code: Select all

        hover "ui/options/hover.png"
        selected_idle "ui/options/hover.png"
        selected_hover "ui/options/hover.png"
Perhaps try having 3 different images there and experimenting.

User avatar
Gear
Miko-Class Veteran
Posts: 764
Joined: Tue Apr 05, 2011 10:15 pm
Projects: Tempestus Sum
Organization: Xenokos Interactive
IRC Nick: Gear
Skype: Skye.Gear
Location: Grand Prairie, TX
Contact:

Re: Professor Layton and the Mystery of the Invisible Hotbar

#7 Post by Gear » Fri Mar 21, 2014 12:53 am

Thank you. It's working now. I'm 98.7 percent sure that I could never duplicate whatever the hell I did to those images to make it work again, but it's working now, and that's good enough for me. Thanks!
The best reason to get up in the morning is to outdo yourself: to do it better than you've ever done it before. But if you haven't done it better by nightfall... look at your globe and pick a spot: it's always morning somewhere.

Post Reply

Who is online

Users browsing this forum: No registered users