[solved!] right_bar not drawing

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
pucedragonlord
Regular
Posts: 159
Joined: Wed May 09, 2012 2:49 am
Projects: The Diviner
Organization: Two Crowns Entertainment
Location: Now: Charlottesville, VA
Contact:

[solved!] right_bar not drawing

#1 Post by pucedragonlord »

I cannot for the life of me figure out why the empty half of a bar isn't showing up. I'll drop the code and examples below, but in short, I have custom styling rules for a bar, but the empty side never shows up. The images it uses seems to check out, the thumb shows up and moves fine, but the empty side of the bar is just missing. There must be something I'm doing wrong, but I'm at a loss.

Code: Select all

    ##in the options.rp file##
    style.diviner = Style(style.default)

    #...non-bar style rules...

    style.diviner_bar.left_bar = "barFull"
    style.diviner_bar.right_bar = "barBase"
    style.diviner_bar.left_gutter = 24
    style.diviner_bar.right_gutter = 24
    style.diviner_bar.thumb = "longThumb"
    style.diviner_bar.thumb_shadow = None
    style.diviner_bar.thumb_offset = 27
    style.diviner_bar.xmaximum = 580
    style.diviner_bar.ymaximum = 50

    ##in a screen##
    bar style "diviner_bar" value 50 range 100
    add "barBase" #the file for the empty bar, to make sure it looks the way it's supposed to.
    add "barFull" #the file for the full bar, to make sure it looks the way it's supposed to.
Attachments
whyBarsWhy.jpg
Last edited by pucedragonlord on Thu Sep 11, 2014 11:00 pm, edited 1 time in total.
The more you know

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: right_bar not drawing

#2 Post by PyTom »

I think we'd need to see what barFull and barBase are.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

pucedragonlord
Regular
Posts: 159
Joined: Wed May 09, 2012 2:49 am
Projects: The Diviner
Organization: Two Crowns Entertainment
Location: Now: Charlottesville, VA
Contact:

Re: right_bar not drawing

#3 Post by pucedragonlord »

They are the two images with comments next to them in the attached file, below the broken bar attempt.

The upper one that looks like two distant triangles is the "barBase" image.
The lower with the line connecting them is "barFull"
The more you know

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: right_bar not drawing

#4 Post by PyTom »

Sure, but how are they defined? How wide are they? What happens if you replace then with Solids - does show the right bar?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

pucedragonlord
Regular
Posts: 159
Joined: Wed May 09, 2012 2:49 am
Projects: The Diviner
Organization: Two Crowns Entertainment
Location: Now: Charlottesville, VA
Contact:

Re: right_bar not drawing

#5 Post by pucedragonlord »

I see. It looks like the right cap was being cut off (exactly, strangely enough -- even when I put something between them it went right up to where it cap should draw and stopped) by the frame width, shrinking them made it show up.

This, however, begs another question: I was under the impression the bars would stretch and squash when given various sizes, but that doesn't seem to happen. A bar with a background width of 300px, for example, always renders at 300px, even when given an xmaximum of 500. The thumb, however, behaves as if it's the larger size. What do I need to do to make them scale? I ultimately want to be able to use these as scrollbars for various lists, and it'll need to have variable sizes or things will look ugly.
The more you know

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: right_bar not drawing

#6 Post by PyTom »

If you want them to scale, you have to make them Frames.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

pucedragonlord
Regular
Posts: 159
Joined: Wed May 09, 2012 2:49 am
Projects: The Diviner
Organization: Two Crowns Entertainment
Location: Now: Charlottesville, VA
Contact:

Re: right_bar not drawing

#7 Post by pucedragonlord »

That hadn't even occurred to me. That should cover all my questions regarding scrollbars. Thanks as always.
The more you know

Post Reply

Who is online

Users browsing this forum: Google [Bot]