Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.


Visit our new games list, blog aggregator, IRC, and wiki.
Activation problem? Email [email protected]
It is currently Sat May 25, 2013 3:34 am

All times are UTC - 5 hours [ DST ]


Forum rules


Ask questions about one topic per thread, and use a descriptive subject. "NotImplemented error in script.rpy" is a good subject, "Tom's problems" is not. Remember to include all of traceback.txt or error.txt when reporting a problem, as well as the relevant lines of script. Use the [code] tag to format scripts.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Feb 09, 2012 9:54 am 
Newbie

Joined: Thu Jan 26, 2012 7:37 pm
Posts: 15
Location: Germany
Projects: Mimik, 30 Days
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.
Attachment:
Bar Problem.png
Bar Problem.png [ 6.03 KiB | Viewed 145 times ]

The third bar is the XP-bar.
Here is the code for the bars.
Code:
    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:
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?

_________________
30 Days
Mimik

Mystery, Kinetic Novel
RPG, H

V 0.0 (50%)
V 0.0 (90%)


Last edited by Saphrot on Thu Feb 09, 2012 12:27 pm, edited 2 times in total.

Top
 Profile Send private message  
 
PostPosted: Thu Feb 09, 2012 11:35 am 
Ren'Py Creator
User avatar

Joined: Mon Feb 02, 2004 10:58 am
Posts: 10780
Location: Kings Park, NY
Completed: Moonlight Walks
Projects: Ren'Py
Do you have a gutter set on the bars?

_________________
Another Old-Fashioned Bishoujo Gamer
Supporting creators since 2004; Code > Drama
(When was the last time you backed up your game?)
"It is not the critic who counts; not the man who points out how the strong man stumbles, or where the doer of deeds could have done them better. The credit belongs to the man who is actually in the arena, whose face in marred by dust and sweat and blood; who strives valiantly; who errs, who comes short again and again, because there is no effort without error and shortcoming" - Theodore Roosevelt


Top
 Profile Send private message  
 
PostPosted: Thu Feb 09, 2012 12:01 pm 
Newbie

Joined: Thu Jan 26, 2012 7:37 pm
Posts: 15
Location: Germany
Projects: Mimik, 30 Days
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.
Attachment:
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%)


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group