A status button that can be clicked on during the gameplay
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
- Chansel
- Veteran
- Posts: 249
- Joined: Sat May 01, 2010 6:11 pm
- Projects: School's Out! -- A GxB or GxG VN/Dating Sim
- Location: The Netherlands, Noord-Brabant
- Contact:
A status button that can be clicked on during the gameplay
Hello everyone!
I've been lurking around for quite some time now and I've found many great solutions to my problems on this forum.
So thanks a million for that! =D
But alas, I haven't been able to figure this out by myself... So I was hoping some of you great minds could help me out ^^
My problem is this:
I have used the cookbook section to create buttons that are visible during the game. One of these buttons is supposed to be for 'Stats'. Meaning that if you click on it, the Status screen pops up showing your stats. You then have to click the 'return' button to go back to your game and that's that.
Simple, right?
Well... not for me ^^"
I've tried everything I could get my hands on, and failed. Miserably. I honestly don't know how to do this... So could someone please help me out with this? Pretty please? With a cherry on top?
ps. I attached two screenshots to illustrate what I mean, just in case.
I've been lurking around for quite some time now and I've found many great solutions to my problems on this forum.
So thanks a million for that! =D
But alas, I haven't been able to figure this out by myself... So I was hoping some of you great minds could help me out ^^
My problem is this:
I have used the cookbook section to create buttons that are visible during the game. One of these buttons is supposed to be for 'Stats'. Meaning that if you click on it, the Status screen pops up showing your stats. You then have to click the 'return' button to go back to your game and that's that.
Simple, right?
Well... not for me ^^"
I've tried everything I could get my hands on, and failed. Miserably. I honestly don't know how to do this... So could someone please help me out with this? Pretty please? With a cherry on top?
ps. I attached two screenshots to illustrate what I mean, just in case.
- Aleema
- Lemma-Class Veteran
- Posts: 2677
- Joined: Fri May 23, 2008 2:11 pm
- Organization: happyB
- Tumblr: happybackwards
- Contact:
Re: A status button that can be clicked on during the gamepl
You can try a simple fix like this:
Where, your stat button is "clicked=ccinc("stats")" (ccinc only if you're using the cookbook code).
Just customize the stats label to look like your screen, and it should work. You might want to disable access to the menu so players aren't tempted to save at that screen (thus screwing up the "return" command).
Code: Select all
label stats:
python:
ui.textbutton("Go Back", clicked=ui.returns("goback"))
$ picked = ui.interact()
if picked == "goback":
returnJust customize the stats label to look like your screen, and it should work. You might want to disable access to the menu so players aren't tempted to save at that screen (thus screwing up the "return" command).
- Chansel
- Veteran
- Posts: 249
- Joined: Sat May 01, 2010 6:11 pm
- Projects: School's Out! -- A GxB or GxG VN/Dating Sim
- Location: The Netherlands, Noord-Brabant
- Contact:
Re: A status button that can be clicked on during the gamepl
Yes, thank you ^^
That solves one of the problems and it's working perfectly.
But I'm afraid that editing the screen to look like my image is a part of my problem... Sorry for not stating this clearly.
I mean, should I use imagemaps as with my main menu?
Or some form of ui?
Or do something I haven't even thought of? (This is most likely)
Sorry if this is a really dumb question, but I just can't find it. I feel utterly lost and overwhelmed by all the python, init and god knows what codes :S
That solves one of the problems and it's working perfectly.
But I'm afraid that editing the screen to look like my image is a part of my problem... Sorry for not stating this clearly.
I mean, should I use imagemaps as with my main menu?
Or some form of ui?
Or do something I haven't even thought of? (This is most likely)
Sorry if this is a really dumb question, but I just can't find it. I feel utterly lost and overwhelmed by all the python, init and god knows what codes :S
- Aleema
- Lemma-Class Veteran
- Posts: 2677
- Joined: Fri May 23, 2008 2:11 pm
- Organization: happyB
- Tumblr: happybackwards
- Contact:
Re: A status button that can be clicked on during the gamepl
Don't fret, I can help. Interfaces are my favorite part, too. :3
This creates two columns, side by side (which is what I see in your example image). Inside of those ui.vbox's (columns) you would put the images (or buttons? I'm not sure what those are) and the text that says how much your stat is. For instance:
ui.frame contains 1 widget, in this case the text, and is desirable because you can change it's background image to whatever. I recommend that you make the "backgroundgraphic" anything that doesn't need to be interacted with, such as the titles and the girl (unless she's dynamic). In which case, the bubble graphic and titles and such wouldn't need to be coded, like I had up there. BUT, you'll have to spend a lot of time aligning the text that you do have to code to match the background.
Does that help?
Nope, those are basically your two options, hehe. Imagemaps are generally easier (because it's easier to build in Photoshop), but since this is menu that needs to display stats, you will need to learn to use the UI functions. The first concept you should grasp is how to make tables out of UI functions.Chansel wrote:I mean, should I use imagemaps as with my main menu?
Or some form of ui?
Or do something I haven't even thought of? (This is most likely)
Code: Select all
label stats:
python:
ui.hbox()
ui.vbox()
ui.close()
ui.vbox()
ui.close()
ui.close()
Code: Select all
label stats:
scene backgroundgraphic
python:
ui.hbox()
# Column 1
ui.vbox()
# Title 1
ui.text("STATS")
# Charisma
ui.frame(background="bubble.png")
ui.text("Charisma: %d"%c_points)
# Fitness
ui.frame(background="bubble.png")
ui.text("Fitness: %d"%f_points)
# Intelligence
ui.frame(background="bubble.png")
ui.text("Intelligence: %d"%i_points)
ui.close()
# Column 2
ui.vbox()
# Title 2
ui.text("APPEARANCE")
# Hair
ui.frame(background="bubble.png")
ui.text("Hair: %d"%h_points)
# Body
ui.frame(background="bubble.png")
ui.text("Body: %d"%b_points)
# Skin
ui.frame(background="bubble.png")
ui.text("Skin: %d"%s_points)
ui.close()
ui.close()
ui.textbutton("Go Back", clicked=ui.returns("goback"), ypos=0.9, xpos=0.5)
$ picked = ui.interact()
if picked == "goback":
returnDoes that help?
- Chansel
- Veteran
- Posts: 249
- Joined: Sat May 01, 2010 6:11 pm
- Projects: School's Out! -- A GxB or GxG VN/Dating Sim
- Location: The Netherlands, Noord-Brabant
- Contact:
Re: A status button that can be clicked on during the gamepl
You. Are. Amazing!!
Thank you so much for your (very quick) help =D
The status screen is finished now, yay ^^
Oh, and let me just say that your RockRobin project looks very interesting. I hope you'll finish that soon ^^ (if you're still working on it. I noticed the post were from 2008 O.o)
Thank you so much for your (very quick) help =D
The status screen is finished now, yay ^^
Oh, and let me just say that your RockRobin project looks very interesting. I hope you'll finish that soon ^^ (if you're still working on it. I noticed the post were from 2008 O.o)
- Aleema
- Lemma-Class Veteran
- Posts: 2677
- Joined: Fri May 23, 2008 2:11 pm
- Organization: happyB
- Tumblr: happybackwards
- Contact:
Re: A status button that can be clicked on during the gamepl
You're welcome, of course. ^^Chansel wrote:Oh, and let me just say that your RockRobin project looks very interesting. I hope you'll finish that soon ^^ (if you're still working on it. I noticed the post were from 2008 O.o)
And thanks for the interest in Rock Robin! I am working on it at this very moment!
As for the post being made in 2008 ... I have no idea what that's about, I started it, like, a month ago. =P
Who is online
Users browsing this forum: No registered users
