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.
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.
##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
Last edited by pucedragonlord on Thu Sep 11, 2014 11:00 pm, edited 1 time in total.
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.