Help with onscreen Stats bar

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
jadeon12
Newbie
Posts: 24
Joined: Sat Mar 05, 2016 6:17 am
Contact:

Help with onscreen Stats bar

#1 Post by jadeon12 »

Hello Fellow Renpy users,

I am making a game where i want the player stats,affection points to be displayed continuously during the game on the left side of the windows in a short bar.
I would also like to change the color of the bar to black like my game background, its now the default green, but i don't know how.

I have tried different things but:
Or the bar is not displayed.
Or only the Text box shows up and the game continues, (pic 1)
Or the bar is displayed but the game does not progress further. (pic2)

Under the daily menu comments i try to call the next function (awaken) but its stays just the window with the bar on it does not go further.
the code i am using is also attached.

I am a novice user, so i would kindly appreciate any help on this, and also suggestions on how to get this bar better.
Attachments
3
3
pic2
pic2
pic1
pic1

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Help with onscreen Stats bar

#2 Post by xela »

Did you try searching the forum? Examples we have on bars are quite comprehensive + there is always documentation.
Like what we're doing? Support us at:
Image

jadeon12
Newbie
Posts: 24
Joined: Sat Mar 05, 2016 6:17 am
Contact:

Re: Help with onscreen Stats bar

#3 Post by jadeon12 »

xela wrote:Did you try searching the forum? Examples we have on bars are quite comprehensive + there is always documentation.
Yes, because i searched on the forum, i made it so far, but now i have not found more detailed on how to proceed.
i have experimented, that's why i posted it here for some help.

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Help with onscreen Stats bar

#4 Post by xela »

You cannot recolor default bars without access to their images. That is usually a bit tricky so either pick a different theme for your project or maybe create your own graphics.

Code: Select all

I have tried different things but:
Or the bar is not displayed.
Or only the Text box shows up and the game continues, (pic 1)
Or the bar is displayed but the game does not progress further. (pic2)
You call a screen if you want the game to wait until it returns something.

You show a screen (like a stats screen) that you wish to be displayed continuously.

==>>
Your code for stats screen looks ok, I didn't see anything on bars.
Like what we're doing? Support us at:
Image

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Help with onscreen Stats bar

#5 Post by xela »

I think I finally understood what you meant, maybe something like this?:

Code: Select all

screen stats():
    frame:
        background Solid("#000000") # Black Solid, you'll have to use some graphic file to make it prettier..
        has vbox
        hbox:
            xsize 200
            text "Health" xalign 0
            text "100" xalign 1.0
        hbox:
            xsize 200
            text "Energy" xalign 0
            text "10" xalign 1.0
            

label start:
    show screen stats
    pause
You got me confused with the "bar', what you are looking for is a frame. For example:

Image

Is a simple bunch of frames and texts inside of a larger frame, for which the code being generally the same as above just with some graphics.
Like what we're doing? Support us at:
Image

jadeon12
Newbie
Posts: 24
Joined: Sat Mar 05, 2016 6:17 am
Contact:

Re: Help with onscreen Stats bar

#6 Post by jadeon12 »

Yes Sir, that i want,

The Screen/frame to the left should stay on during the game so when the player levels up, or is injured or collects money the stats/ Figures can be seen, while the game keeps playing the textbox to the right.

jadeon12
Newbie
Posts: 24
Joined: Sat Mar 05, 2016 6:17 am
Contact:

Re: Help with onscreen Stats bar

#7 Post by jadeon12 »

What should i add or adjust in the code to achieve that result?
A permanent window on the side displaying the players stat points, health,strength,money ect...
with the game playing in the big text box on the right side.

Right now as we can see it displays the stats screen frame with Skill 7, Strength ect... but the game itself does not proceed, its as if it stuck there, it does not call the "awaken" function.

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: Help with onscreen Stats bar

#8 Post by gas »

The call statement have a screen close after the next interaction.
Use SHOW SCREEN to have a screen persist.

A BAR is a slider, not a panel.

're you sure you're opened at least once the documentation? It's more helpfull than waiting for answers from the web, I swear!!!
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

jadeon12
Newbie
Posts: 24
Joined: Sat Mar 05, 2016 6:17 am
Contact:

Re: Help with onscreen Stats bar

#9 Post by jadeon12 »

gas wrote:The call statement have a screen close after the next interaction.
Use SHOW SCREEN to have a screen persist.

A BAR is a slider, not a panel.

're you sure you're opened at least once the documentation? It's more helpfull than waiting for answers from the web, I swear!!!
Yeah

Its is working now nicely, now i can proceed.

Thank you very much for your help Eileen.
you also gas

Post Reply

Who is online

Users browsing this forum: Google [Bot]