Help with displayables and menus please
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.
- Chibi Kami
- Newbie
- Posts: 8
- Joined: Thu Jun 12, 2008 12:19 am
- Projects: Mad Science Experiment (unfinished)
- Contact:
Help with displayables and menus please
First, a rant: The extensive manual, tutorial, etc. provided with Ren'Py suffers from the same thing that every other coding manual suffers from; It's great at telling you what, ocassionally it tells you how, and it almost never tells you why.
Why things work, especially the numbers stated (because 1.5 can't be possibly be pixel coordinates), is the key question.
Now that I've got that explanation of why I can't figure this out out of the way, here's the problem.
I'm trying to set up a panel on the left side (about 1/4 of 800x600 (200 wide) (though I was thinking of 1024x768 (256 wide) because I hate downsizing my artwork too much)) of the screen.
I gather that this can be done with the displayables commands, but it's bordering on sanskrit to me.
I want to display categorized numerical stats (stats might be indented. Not sure) on the upper portion, and a menu of choices/interactions on the lower portion.
I can code what the choices will do, but I do need to know how to position them
Format example
__________________________________________________________
|Category 1(possibly an image)
|stat1 #
|stat2 #
|stat3 #
|Category 2
|stat4 #
|stat5 #
|
|menu choice 1
|choice 2
|choice 3
|
|_________________________________________________________
Like that.
Here's the part where I get told to gtfo.
Can anyone create a code template that will do this, along with explaining the more complicated bits?
Or, if a pre-existing template or ren'py game with such a format (and uncompressed code) exists that I have overlooked, can someone point me to it?
Thanks for any and all help, no thanks for flames.
Why things work, especially the numbers stated (because 1.5 can't be possibly be pixel coordinates), is the key question.
Now that I've got that explanation of why I can't figure this out out of the way, here's the problem.
I'm trying to set up a panel on the left side (about 1/4 of 800x600 (200 wide) (though I was thinking of 1024x768 (256 wide) because I hate downsizing my artwork too much)) of the screen.
I gather that this can be done with the displayables commands, but it's bordering on sanskrit to me.
I want to display categorized numerical stats (stats might be indented. Not sure) on the upper portion, and a menu of choices/interactions on the lower portion.
I can code what the choices will do, but I do need to know how to position them
Format example
__________________________________________________________
|Category 1(possibly an image)
|stat1 #
|stat2 #
|stat3 #
|Category 2
|stat4 #
|stat5 #
|
|menu choice 1
|choice 2
|choice 3
|
|_________________________________________________________
Like that.
Here's the part where I get told to gtfo.
Can anyone create a code template that will do this, along with explaining the more complicated bits?
Or, if a pre-existing template or ren'py game with such a format (and uncompressed code) exists that I have overlooked, can someone point me to it?
Thanks for any and all help, no thanks for flames.
-
maselphie
- Regular
- Posts: 71
- Joined: Fri May 23, 2008 2:12 pm
- Projects: By The Lake, Seraphine
- Location: USA
- Contact:
Re: Help with displayables and menus please
^_^ Well, I've haven't seen a "1.5" pixel coordinate, but the decimal points in positioning items are under the assumption that the full width of the screen is equal to 1, so positioning something at 0.5 would be like positioning something at 50% the designated screen width (aka centering it).
Keep in mind that the people who wrote the tutorials are active on this board, and may be the very ones to help you, so try asking questions without degrading their efforts so far ... ^^;;
Everything you need to make your window (which you'll probably want to define as an "overlay") can be found in the DSE (dating sim engine) and RPG stats demo. I'd love to learn alongside you about this, but some things we have to get our hands dirty and play around in the code ourselves. That's the best way we'll learn -- trial and error. I'll see what I can cook up and I'll share with you what I find. That is, of course, someone wants to just write our game for us. ^_^
Keep in mind that the people who wrote the tutorials are active on this board, and may be the very ones to help you, so try asking questions without degrading their efforts so far ... ^^;;
Everything you need to make your window (which you'll probably want to define as an "overlay") can be found in the DSE (dating sim engine) and RPG stats demo. I'd love to learn alongside you about this, but some things we have to get our hands dirty and play around in the code ourselves. That's the best way we'll learn -- trial and error. I'll see what I can cook up and I'll share with you what I find. That is, of course, someone wants to just write our game for us. ^_^
I have switched accounts to Aleema.
- Chibi Kami
- Newbie
- Posts: 8
- Joined: Thu Jun 12, 2008 12:19 am
- Projects: Mad Science Experiment (unfinished)
- Contact:
Re: Help with displayables and menus please
I wasn't trying to insult the writers of the manual and tutorials, merely point out that they share a problem common to every coding manual I've seen. Interestingly enough, the tutorials do a good job of explaining why the effects work as tehy do, but there aren't enough tutorials on higher end functions.
I have most of the game written down, most of the art drawn, and about 30% of the scenarios coded. All I'm looking for is an interface template.
I'd try the included DSE and RPG templates for analysis, but there's a small problem. I can't find them in Ren'Py's directories. Where are they?
I have most of the game written down, most of the art drawn, and about 30% of the scenarios coded. All I'm looking for is an interface template.
I'd try the included DSE and RPG templates for analysis, but there's a small problem. I can't find them in Ren'Py's directories. Where are they?
-
maselphie
- Regular
- Posts: 71
- Joined: Fri May 23, 2008 2:12 pm
- Projects: By The Lake, Seraphine
- Location: USA
- Contact:
Re: Help with displayables and menus please
DSE is a framework found here. And the RPG menus are actually found in the demo game included with Ren'Py. Do you remember seeing it there?
Basically, you'll have to learn the UI functions, I believe. "ui.vbox", nested in a "ui.window" or "ui.frame" might do the trick. And to display the statistics you'll use "ui.text" probably. ^^
And somehow, regardless of coding manuals' failures to correctly walk you through what you want, negative comments can still be taken negatively. Just giving you a tip for future favors to be asked. ^_^
Basically, you'll have to learn the UI functions, I believe. "ui.vbox", nested in a "ui.window" or "ui.frame" might do the trick. And to display the statistics you'll use "ui.text" probably. ^^
And somehow, regardless of coding manuals' failures to correctly walk you through what you want, negative comments can still be taken negatively. Just giving you a tip for future favors to be asked. ^_^
I have switched accounts to Aleema.
- chronoluminaire
- Eileen-Class Veteran
- Posts: 1153
- Joined: Mon Jul 07, 2003 4:57 pm
- Completed: Elven Relations, Cloud Fairy, When I Rule The World
- Tumblr: alextfish
- Skype: alextfish
- Location: Cambridge, UK
- Contact:
Re: Help with displayables and menus please
Sounds like you could do with checking out the UI Functions.
See this thread for an example. The UI Functions reference page is here. A lot of the functions have little examples on their pages.
See this thread for an example. The UI Functions reference page is here. A lot of the functions have little examples on their pages.
I released 3 VNs, many moons ago: Elven Relations (IntRenAiMo 2007), When I Rule The World (NaNoRenO 2005), and Cloud Fairy (the Cute Light & Fluffy Project, 2009).
More recently I designed the board game Steam Works (published in 2015), available from a local gaming store near you!
More recently I designed the board game Steam Works (published in 2015), available from a local gaming store near you!
- Chibi Kami
- Newbie
- Posts: 8
- Joined: Thu Jun 12, 2008 12:19 am
- Projects: Mad Science Experiment (unfinished)
- Contact:
Re: Help with displayables and menus please
Okay, it's a day later, my brain isn't as cooked, the California heat isn't as bad as before, and last night I put on some background music and came up with this (btw, thanks for pointing me toward the ui functions, specifically window):
Lint check indicates "expected statements" where a carat (one of these: ^ ) is pointing
ui.window(xpos=0, ypos=0, xanchor='left', yanchor='top', xmininum=256)
...............................................................^
ui.vbox(xpos=0, xanchor='left')
................................^
ui.text("Stats") #used for category
..............^
ui.text("statname: %(stat1)d")
............................^
ui.text("statname: %(stat2)d")
............................^
ui.text("statname: %(stat3)d")
............................^
ui.close()
.........^ #yes, seriously. It expects a statement in the close command
I've checked my syntax repeatedly and found no errors. I checked it against the DSE (old ver)and found no difference in my setup other than a lack of xfill argument (an item i didn't understand as it seems to have no listing in the help file), and setup under a python hide command. It might be possible that ui boxes don't accept variables, but that doesn't account for the other errors.
I'm thinking the python is what's necessary but the DSE calls a renpy.routinename (forgot what exactly) under the python command, which I imagine controls the behavior.
I don't know what routine to use, so it's on hold at the moment.
What now?
Lint check indicates "expected statements" where a carat (one of these: ^ ) is pointing
ui.window(xpos=0, ypos=0, xanchor='left', yanchor='top', xmininum=256)
...............................................................^
ui.vbox(xpos=0, xanchor='left')
................................^
ui.text("Stats") #used for category
..............^
ui.text("statname: %(stat1)d")
............................^
ui.text("statname: %(stat2)d")
............................^
ui.text("statname: %(stat3)d")
............................^
ui.close()
.........^ #yes, seriously. It expects a statement in the close command
I've checked my syntax repeatedly and found no errors. I checked it against the DSE (old ver)and found no difference in my setup other than a lack of xfill argument (an item i didn't understand as it seems to have no listing in the help file), and setup under a python hide command. It might be possible that ui boxes don't accept variables, but that doesn't account for the other errors.
I'm thinking the python is what's necessary but the DSE calls a renpy.routinename (forgot what exactly) under the python command, which I imagine controls the behavior.
I don't know what routine to use, so it's on hold at the moment.
What now?
- JQuartz
- Eileen-Class Veteran
- Posts: 1265
- Joined: Fri Aug 31, 2007 7:02 am
- Projects: 0 completed game. Still haven't made any meaningfully completed games...
- Contact:
Re: Help with displayables and menus please
The ui.functions are python codes so you'll either need to put python: on the top of the block like so:
or a $ sign before each line like so:
Code: Select all
python:
ui.window(xpos=0, ypos=0, xanchor='left', yanchor='top', xmininum=256)
ui.vbox(xpos=0, xanchor='left')
ui.text("Stats") #used for category
ui.text("statname: %(stat1)d")
ui.text("statname: %(stat2)d")
ui.text("statname: %(stat3)d")
ui.close()Code: Select all
$ ui.window(xpos=0, ypos=0, xanchor='left', yanchor='top', xmininum=256)
$ ui.vbox(xpos=0, xanchor='left')I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.
Who is online
Users browsing this forum: No registered users


