Empty bar is not empty [Solved]

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
Saphrot
Newbie
Posts: 15
Joined: Thu Jan 26, 2012 7:37 pm
Projects: Mimik, 30 Days
Location: Germany
Contact:

Empty bar is not empty [Solved]

#1 Post by Saphrot »

Hello, I have a small problem with the ui.bar.
I made some bars to display the HP, SP and XP of the character, but when the bar should be empty, it's not.
As can be seen here. I cropped the picture a little and marked the problem areas.
Bar Problem.png
Bar Problem.png (6.03 KiB) Viewed 657 times
The third bar is the XP-bar.
Here is the code for the bars.

Code: Select all

    def Charstats():
        if char_stats: # XP Leiste erstellen
            ui.image("Leiste Grund.png", xpos=5, ypos=5, xanchor='left', yanchor='top')
            ui.bar(HP_bar_max, HP_bar, xmaximum = 264, xpos=8, ypos=8, xanchor='left', yanchor='top', thumb=None, left_bar="Leiste Gruen.png", right_bar=None)
            ui.image("Leiste Grund.png", xpos=5, ypos=36, xanchor='left', yanchor='top')
            ui.image("Leiste Grund.png", xpos=5, ypos=67, xanchor='left', yanchor='top')
            if magic_learned:
                ui.bar(MP_bar_max, MP_bar, xmaximum = 264, xpos=8, ypos=39, xanchor='left', yanchor='top', thumb=None, left_bar="Leiste Blau.png", right_bar=None)
                ui.bar(SP_bar_max, SP_bar, xmaximum = 264, xpos=8, ypos=70, xanchor='left', yanchor='top', thumb=None, left_bar="Leiste Gelb.png", right_bar=None)
                ui.image("Leiste Grund.png", xpos=5, ypos=98, xanchor='left', yanchor='top')
                ui.bar(LVLUP, XP, xmaximum = 264, xpos=8, ypos=101, xanchor='left', yanchor='top', thumb=None, left_bar="Leiste Gelb.png", right_bar=None)
            else:
                ui.bar(SP_bar_max, SP_bar, xmaximum = 264, xpos=8, ypos=39, xanchor='left', yanchor='top', thumb=None, left_bar="Leiste Gelb.png", right_bar=None)
                ui.bar(LVLUP, XP, xmaximum = 264, xpos=8, ypos=70, xanchor='left', yanchor='top', thumb=None, left_bar="Leiste Gelb.png", right_bar=None)
    config.overlay_functions.append(Charstats)
And the code for the textbutton, just for clarification.

Code: Select all

def Datenanzeige():
        if data_show and not kampf:
            ui.image(DATA_BG, xpos=280, ypos=0, xanchor='left', yanchor='top')
            if character_data_show: # Fertig
                ui.vbox(xpos=300, ypos=20, xanchor='left', yanchor='top', spacing=5) # Haupt VBOX
                ui.hbox(spacing=5) # HBOX NAME/LVL
                ui.textbutton("Name: [spielername]", xminimum=400, yminimum=35, clicked=empty, hovered=tt_name, unhovered=tt_off)
                ui.textbutton("Level: [level]", xminimum=200, yminimum=35, clicked=empty, hovered=tt_level, unhovered=tt_off)
                ui.textbutton("Experience: [XP] / [LVLUP]", xminimum=350, yminimum=35, clicked=empty, hovered=tt_experience, unhovered=tt_off)
                ui.close() # HBOX NAME/LVL
                ... # I removed some lines here, because they are not relevant to the bars.
                ui.close() # Haupt VBOX
            ... # Same here.
    config.overlay_functions.append(Datenanzeige)
Am I using the bars wrong? Or is it not possible to completely empty a bar?
Last edited by Saphrot on Thu Feb 09, 2012 12:27 pm, edited 2 times in total.
30 Days
Mimik
Mystery, Kinetic Novel
RPG, H
V 0.0 (50%)
V 0.0 (90%)

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: Empty bar is not empty

#2 Post by PyTom »

Do you have a gutter set on the bars?
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

Saphrot
Newbie
Posts: 15
Joined: Thu Jan 26, 2012 7:37 pm
Projects: Mimik, 30 Days
Location: Germany
Contact:

Re: Empty bar is not empty

#3 Post by Saphrot »

A gutter? Ah ok, that's what is missing, thank you very much.
I didn't know that coulb be set, thank you.
Was probably a pretty stupid question, in hindsight.
Edit:
It works now. Thank you so much.
Bar Problem gelöst.png
(10.23 KiB) Not downloaded yet
30 Days
Mimik
Mystery, Kinetic Novel
RPG, H
V 0.0 (50%)
V 0.0 (90%)

Post Reply

Who is online

Users browsing this forum: Google [Bot], Semrush [Bot]